Partager via


Web Deploy sync Operation

Applies To: Windows 7, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Vista, Windows XP

sync

The sync operation synchronizes data between a source and a destination.

Example

msdeploy -verb:sync -source:webServer -dest:webServer,computerName=Server2

The sync (synchronize) operation makes one source and one destination object identical. Both a source (-source) and a destination (-dest) argument must be specified. The source and destination can be a Web site, Web server, or any data source supplied by a Web Deploy provider. For more about providers, see Web Deploy Providers.

A sync operation gets a dump of the source, a dump of the destination, and then does a node-by-node comparison of the results. Rules and link extensions check every node to determine what must be added, deleted, or updated. For more information about rules and link extensions, see Web Deploy Rules and Web Deploy Link Extensions.

Important things to remember

  • If your sync operation includes a remote Web server, make sure that the Web Deploy remote service has been installed and is running on the remote computer before you start. For more information, see Web Deploy Remote Service.

  • During a sync operation, Web Deploy automatically detects if encrypted objects are present in server-level configuration files (for example, the Applicationhost.config and Machine.config files), and will expect a password to have been specified for the destination by the encryptPassword provider setting. If you do not specify a valid value when a password is required, the sync operation will fail. For more information, see the encryptPassword entry in the Web Deploy Provider Settings topic.

  • In order for the sync operation to function correctly, the Msdeploy.exe.configsettings file must be the same on the source and destination computers. If you add any rules or custom providers to the Msdeploy.exe.configsettings file, make sure that this configuration file is identical on the source and the destination computers before you perform a synchronization.

  • If you attempt to synchronize an entire Web server configuration from a 64-bit computer to a 32-bit computer, you must use the WoW (Windows on Windows) version of Msdeploy.exe that is located in the Program Files (x86)\IIS\Microsoft Web Deploy directory. This is important when the Machine.config and root Web.config files are being synchronized.

  • Because the FAT file system cannot preserve NTFS file system ACLs, you should not synchronize files from an NTFS file system to a FAT file system. If you do so, no warning will be issued. Note that, in any case, Windows Server® 2008 (and IIS 7) cannot be installed on FAT32 file systems. For security reasons, the use of IIS 6.0 on FAT file systems is not recommended.

Warning

Using Web Deploy to synchronize Web content or configuration from a later version of IIS or Windows to an earlier version of IIS or Windows is not recommended. For example, you should not synchronize from IIS 7 to IIS 6.0, or synchronize Web content and configuration from Windows Server® 2008 R2 to Windows Server® 2008, or from an operating system that has a service pack to the same operating system that has an earlier service pack, or no service pack. Differences in schema files can render the results of such synchronizations unusable.

Example Usages

1) Synchronize the contents of the c:\Site2 directory on the local computer based on the contents of the c:\Site1 directory on the local computer.

msdeploy -verb:sync -source:contentPath="c:\Site1" -dest:contentPath="c:\Site2"

2) Use the local computer to synchronize the remote Web server named Server2.

msdeploy -verb:sync -source:webServer -dest:webServer,computerName=Server2

3) Use remote Server2 to synchronize the local Web server.

msdeploy -verb:sync -source:webServer,computerName=Server2 -dest:webServer

4) Use remote Web server named Server2 to synchronize the remote Web server named Server3.

msdeploy -verb:sync -source:webServer,computerName=Server2 -dest:webServer,computerName=Server3

See Also

Web Deploy Operations

Web Deploy dump Operation

Web Deploy Providers

Synchronizing from 32–bit to 64–bit