The Web Deploy utility has different options in the -source argument and an understanding of each option and the level the argument interacts with in IIS will make the migration so much easier.

 

 This chart illustrates the IIS object level and the Web Deploy argument for the –source. The –whatif command is used in each example just to ensure the target web site is not over written while testing these commands.

IIS Object Level

Web Deploy -source Example

Server Level

webServer

msdeploy.exe -verb:sync -source:webServer,computername=10.0.0.11 -dest:webServer,computername=10.0.0.12 -whatif > c:\_WebDeploy\ServerDiff2.txt

OR

msdeploy -verb:sync -source:webserver  -dest:webserver,computername=10.0.0.11 -whatif

Complete Web Site

Includes bindings and certificate information.

appHostConfig

msdeploy -verb:sync -source:appHostConfig="Hello" -dest:appHostConfig="Hello",computerName=10.0.0.12 -enableLink:AppPoolExtension -whatif > c:\_webdeploy\HelloUpdate.txt

Hello = Web Site

Web Site File Contents

Files only and no configuration information.

contentPath

msdeploy.exe -verb:sync -source:contentPath="Hello" -dest:contentPath="Hello",computername=10.0.0.12 -whatif

Application under a site

iisApp msdeploy -verb:sync -source:iisApp="Hello/TestWD" -dest:iisApp="Hello/TestWD",computername=10.0.0.12 -whatif

Directory level

dirPath

msdeploy -verb:sync -source:dirPath=C:\inetpub\wwwroot\Hello\TestWD -dest:dirPath=C:\inetpub\wwwroot\Hello\TestWD,computername=10.0.0.12 -whatif

File Level filePath msdeploy -verb:sync -source:filePath=C:\inetpub\wwwroot\Hello\TestWD\Hello.html -dest:filePath=C:\inetpub\wwwroot\Hello\TestWD\Hello.html;computername=10.0.0.12 -whatif