This method is used to migrate web site files to a new server or synchronize the files between two servers.

The contentPath provider enables you to dump, synchronize, or archive all content of the path specified. The path selected can be a physical directory path, file path, or an IIS Web site or application path like Contoso/Benefits.

By specifying an IIS Web site or application path, the provider will retrieve content separately from certificates, assemblies, or IIS configuration data and will synchronize just the files.

Here is the link to the TechNet content about the contentPath provider-

Note: This scenario can only be accomplished with the Web Deploy command line.

Example Syntax:

msdeploy -verb:sync -source:contentPath ="" -dest:contentPath="",computername=

  • Web Site =

Migration Options:

The syntax presented in this blog post uses the web site path and the other options are the following:

  • A directory path (for example, c:\web\contoso)
  • A file path (for example, c:\web\contoso\main.htm)
  • A site path (for example, "Contoso" or MySite)
  • An application path (for example, "Contoso/Benefits"or Contoso/Benefits/default.htm)

Verify before Execution:

From the command prompt, enter the following commands to create a differencing file and mechanism to review errors and warnings before generating the package file:

msdeploy -verb:sync -source:contentPath="" -dest:contentPath="",computername= -whatif > c:\_WebDeploy\ContosoDiff.txt

Inspect the output in the text file by searching on Error and Warning and resolve the issues before generating the package. Again, the pipe command to the file is optional and output from the WhatIf command can be viewed within the command window.

Note: If the application on the Target does not exist, the output from the -whatif statement will show all adds and no deletes.

Package Transfer Method:

Create Application Package on Source Server:

Command Line:

msdeploy -verb:sync -source:contentPath="" -dest:package=c:\_WebDeploy\

Copy the Web Deploy package to the new server.

Import Package on Remote Server:

Command Line:

msdeploy -verb:sync -source:c:\_WebDeploy\ -dest:contentPath="" > c:\_webdeploy\ContosoDeployment.txt

Command Line Method without Packages:

This method generates a server to server transfer of the web application and omits the use of packages. It will synchronize the differences between the source and the target server at the application level.

msdeploy -verb:sync -source:contentPath="" -dest:contentPath="",computername= > c:\_WebDeploy\ContosoDeployment.txt