web deploy 이용 IIS 서버 간 마이그레이션 각
작업시 오타주의필요
1. Source Server에 Web Deploy 3.6 설치
https://www.iis.net/downloads/microsoft/web-deploy
2. Appcmd 명령어 이용 Site 및 pool xml export
%windir%\system32\inetsrv\appcmd list apppool /config /xml > c:\apppools.xml
%windir%\system32\inetsrv\appcmd list site /config /xml > c:\sites.xml
3. Xml열어서 확인
4. Appcmd 명령어 이용 Site 및 pool xml import
%windir%\system32\inetsrv\appcmd add apppool /in < c:\temp\web\apppools.xml
%windir%\system32\inetsrv\appcmd add site /in < c:\temp\web\sites.xml
5. Msdeploy export(각 사이트별)
msdeploy -verb:getDependencies -source:metakey=lm/w3svc/1
msdeploy -verb:getDependencies -source:metakey=lm/w3svc/2
msdeploy -verb:getDependencies -source:metakey=lm/w3svc/3
msdeploy -verb:sync -source:metakey=lm/w3svc/1 -dest:package=c:\Site1.zip > WebDeployPackage1.log
msdeploy -verb:sync -source:metakey=lm/w3svc/2 -dest:package=c:\Site2.zip > WebDeployPackage2.log
msdeploy -verb:sync -source:metakey=lm/w3svc/3 -dest:package=c:\Site3.zip > WebDeployPackage3.log
6. Target Server 파일 복사
a. 사이트 및 pool xml파일 : 사이트/pool 일괄
b. msdeploy zip파일 복사
c. 웹사이트 실제소스 복사(경로확인)
7. Msdeploy import(각 사이트별)
msdeploy -verb:sync -source:package=C:\temp\web\Site1.zip -dest:metakey=lm/w3svc/1 -whatif > WebDeploySync1.log
msdeploy -verb:sync -source:package=C:\temp\web\Site2.zip -dest:metakey=lm/w3svc/2 -whatif > WebDeploySync2.log
msdeploy -verb:sync -source:package=C:\temp\web\Site3.zip -dest:metakey=lm/w3svc/3 -whatif > WebDeploySync3.log
트러블슈팅
오류코드 예시
Error Code: ERROR_EXCEPTION_WHILE_CREATING_OBJECT
[14:09:33][Step 6/6] More Information: Object of type 'package' and path 'Artifacts\ProjectName.csproj.zip' cannot be created. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_EXCEPTION_WHILE_CREATING_OBJECT.
[14:09:33][Step 6/6] Error: The Zip package 'Artifacts\ProjectName.csproj.zip' could not be loaded.
[14:09:33][Step 6/6] Error: Could not find a part of the path 'Artifacts\ProjectName.csproj.zip'.
[14:09:33][Step 6/6] Error count: 1.
-> 원인 : msdeploy export 된 zip파일명을 잘못 지정했음.
msdeploy export limit 존재함, 4GB 이상 이면 오류
ERROR_PACKAGE_TOO_LARGE
Diagnosis: The package or backup being created exceeds the maximum size of 4GB.
Resolution: Use the archiveDir provider when creating a package instead. Currently there is no solution for this limit with respect to automatic backups.
msdeploy -verb:sync -source:apphostconfig="Site1" -dest:archivedir=c:\archive
msdeploy -verb:sync -source:archivedir=c:\archive -dest:appHostConfig="Site1",computerName=NewServer
ERROR_FRAMEWORK_VERSIONS_DO_NOT_MATCH
아래와 같이 import시 닷넷프레임워크 버전을 전부 지정해주면 실행성공함.
msdeploy -verb:sync -source:apphostconfig="WebSite1",machineconfig32.netfxversion=2,machineconfig64.netfxversion=2,
rootwebconfig32.netfxversion=2,rootwebconfig64.netfxversion=2 -dest:apphostconfig="WebSite1",machineconfig32.netfxversion=2,machineconfig64.netfxversion=2,
rootwebconfig32.netfxversion=2,rootwebconfig64.netfxversion=2,
computername=10.1.1.19 -enablelink:AppPoolExtension -verbose –whatif
출처: <https://blogs.msdn.microsoft.com/ericparvin/2015/04/03/error_framework_versions_do_not_match/>
그외
Troubleshooting Common Problems with Web Deploy
'기술(MS,Web,Windows,AWS) > [MS]IIS' 카테고리의 다른 글
번역 [UploadReadAheadSize] Exchange SSL Preload will use this value on iis metabse.xml (0) | 2016.04.07 |
---|