Synchronize IIS 6.0

  • Author: Faith Allington
  • Published on April 07, 2008 by faith_a
  • Updated on September 01, 2009 by faith_a

This quick guide will guide you through the process of using the Web Deployment Tool to sync a web site from a source to a destination on IIS 6.0. You can do this by "pushing" data to a remote destination, or by "pulling" data from a remote source. This guide will show both methods, as well as an option to just use an archive folder and not install the remote service.

What are the ways you can sync using the Web Deployment Tool?

  • Push (sync from a local source to a remote destination)
  • Pull (sync from a remote source to a local destination)
  • Independent Sync (initiate a sync from a machine where both destination and source are remote)
  • Manual Local Sync (create an archive of the source and copy it to the destination, then run it locally)

Prerequisites

This guide requires the following prerequisites:

  • .NET Framework 2.0 SP1 or greater
  • Web Deployment Tool 1.0

Note: If you have not already installed the Web Deployment Tool, see Installing the Web Deployment Tool.

Part 1 - View your site's dependencies

1. Get the dependencies of the web site by running the following command:

msdeploy -verb:getDependencies -source:metakey=lm/w3svc/1

2. Review the output of the dependencies and look for any script maps or installed components in use by the site. For example, if Windows Authentication is in use by the web site, you will see <dependency name="WindowsAuthentication" />.

3. If your site is inheriting any script maps, these will not be listed in the dependencies and you should also review the script maps for your site manually.

4. Compile a list of the components needed on the destination.

For detailed steps on analyzing the output of getDependencies, see Viewing Dependencies of a Web site.

 

Part 2 - Configure the target (destination)

1. Review the list of dependencies and install them on the destination server.

For example, let’s assume you had the following in use for your web site:

• ASP.NET

• Windows Authentication

• Anonymous Authentication

Based on analyzing your dependencies, you would install those components.

 

Part 3 – Sync your site to the target

1. Always make a backup of the destination and source servers. Even if you are just testing, it allows you to easily restore the state of your server.

2. Install the remote service on the source or the destination depending on if you want to "pull" the data from a remote source or "push" the data to a remote destination.

3. Start the service on the machine.

net start msdepsvc 

4. Run the following command to validate what would happen if the sync were run. The whatif will not show every change, it will just show an optimistic view of what might be changed if everything succeeds (doesn't catch errors where you can't write to the destination, etc.)

Pushing to remote destination, running on source machine
msdeploy -verb:sync -source:metakey=lm/w3svc/1 -dest:metakey=lm/w3svc/1,computername=Server1 -whatif > msdeploysync.log

Pulling from a remote source, running on destination machine
msdeploy -verb:sync -source:metakey=lm/w3svc/1,computername=Server1 -dest:metakey=lm/w3svc/1 -whatif > msdeploysync.log

5. After verifying the output, run the same command again without the whatif flag:

Pushing to remote destination, running on source machine
msdeploy -verb:sync -source:metakey=lm/w3svc/1 -dest:metakey=lm/w3svc/1,computername=Server1 > msdeploysync.log

Pulling from a remote source, running on destination machine
msdeploy -verb:sync -source:metakey=lm/w3svc/1,computername=Server1 -dest:metakey=lm/w3svc/1 > msdeploysync.log

 

{Optional - Sync your site to the target using an archive}

If you don't wish to sync from an archive, you can sync using the remote service. 

1. Run the following command on the destination server to take an archive of the server for synchronization:

msdeploy -verb:sync  -source:metakey=lm/w3svc/1 -dest:archivedir=c:\site1archive

2. Copy the archive folder to the destination server. 

3. Run the following command on the destination server to validate what would happen if a sync was run:

msdeploy -verb:sync -source:archivedir=c:\site1archive -dest:metakey=lm/w3svc/1 -whatif > msdeploysync.log

4. After verifying the output, run the same command again without the whatif flag:

msdeploy -verb:sync -source:archivedir=c:\site1archive -dest:metakey=lm/w3svc/1 > msdeploysync.log

You are now done synchronizing your site. To verify, test browsing to the web site on the destination server. For troubleshooting help, see Troubleshooting the Web Deployment Tool.

Summary

You have now synchronized a web site from a source IIS 6.0 server to a destination IIS 6.0 server, including viewing the dependencies, configuring the destination IIS 6.0 server and performing the synchronization.

Comments

Hi when I look at the sync log file it says "Change count: 0" What does that mean? Also this appears to be running but not syncing anything. The target iis server is not serving.

Jul 22 2008 by bryancti

Hi, change count 0 means that no changes were detected between the source and destination (target). Please submit your question to our forum at http://forums.iis.net/1144.aspx, along with the full command you are running. thanks, faith

Jul 28 2008 by faith_a

As I understand both IIS servers should be up and running? Or it is possible to copy sites from a "down" server (like http://www.hoststools.com tool does)?

Sep 15 2008 by Saho

Please ask your questions in http://forums.iis.net/1144.aspx. Thanks!

Sep 15 2008 by steve schofield

In the summary it mentions IIS 7.0 but this guide is about IIS 6.0.
Usual copy/paste/replace problems. :)

Jan 29 2009 by manuelb

According to the documentation, msdepsvc and msdeploy are features of IIS 7.0, not IIS 6.0. This articel is useless!

May 14 2009 by pwyatt1

Thanks for the great article - although there are a few mistakes, anyone with a brain can get round these :D

re: peywatt1 - Download the 'Web Developement Tool' mentioned in the first line of this article to get these working for IIS 6.0.

http://learn.iis.net/page.aspx/346/web-deployment-tool/

Jun 03 2009 by jagdipa

Submit a Comment

You must Log In to comment.

Microsoft Communities