This article will guide you through the process of using MS Deploy to sync a single web site from IIS 6.0 to another IIS 6.0 server. To sync the entire server, using the webserver60 provider instead of metakey=lm/w3svc/1.
Article Goal: To synchronize a web site from IIS 6.0 to another IIS 6.0 server. I’m running ASP.NET so I need to ensure it will work after synchronization.
Prerequisites
This article requires the following prerequisites:
• .NET Framework 2.0 SP1 or greater
• MS Deploy Go Live
Note: If you have not already installed MS Deploy, see Installing MS Deploy.
Part 1 - View dependencies of the source
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 or destination machine
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 – To sync the site to the source server
1. Always make a backup of the destination server. Even if you are just testing, it allows you to easily restore the state of your server. Create a backup of the server using iisback.vbs or by right-clicking on the server node in the IIS Manager and choosing All Tasks > Backup...
2. 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
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
Note: If you don't wish to sync from an archive, you can sync using the remote service. Specify computerName with the name of your server, such as Server1. If you are not running on the default port and URL, you need to specify the full URL, such as http://Server1:8080/msdeploy. For example, change the source to
source:metakey=lm/w3svc/1,computerName=server1
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
Note: You should copy the archive to the remote machine.
Note: If you don't wish to sync from an archive, you can sync using the remote service. Specify computerName with the name of your server, such as Server1. For example, change the dest to
dest:metakey=lm/w3svc/1,computerName=server1. If you are not running on the default port and URL, you need to specify the full URL, such as http://Server1:8080/msdeploy.
You are now done synchronizing your site. To verify, test browsing to the web site on the destination server. For troubleshooting help, see Troubleshooting MS Deploy.
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