This quick guide will help you migrate a Web site from IIS 6.0 to IIS 7.0 using the Web Deployment Tool.
What kinds of migrations can I accomplish with the Web Deployment Tool?
- Migrate 1 or 1,000 web sites from IIS6 to IIS7 including all the configuration settings, content and certificates
- Migrate a single application
- Migrate an entire server (all web sites, app pools, etc.) from IIS6 to IIS7
- Migrate a custom manifest comprised of sites, app pools, assemblies, COM objects, registry keys, content and more from IIS6 to IIS7
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
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 and modules.
Part 3 – Migrate your site to the target
Important tip: In the final release of the Web Deployment Tool, we removed the "migrate" verb and you should now use "sync" instead.
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.
2. Run the following command on the source server to take an archive of the server for synchronization:
msdeploy -verb:sync -source:metakey=lm/w3svc/1 -dest:archivedir=c:\site1archive > msdeployarchive.log
3. Copy the archive folder to the destination server.
3. Run the following command on the destination server to validate what would happen if a migrate 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
{Optional - Migrate your site to the target using the remote service}
If you don't wish to migrate from an archive, you can migrate using the remote service.
1. Install the remote service on either the source or the destination depending on whether you want to sync from a remote source or to a remote destination.
2. Start the service on the machine.
net start msdepsvc
3. Run the following command to do a "push" synchronization from the local source to a remote destination (replace Server1 with your machine name):
msdeploy -verb:sync -source:metakey=lm/w3svc/1 -dest:metakey=lm/w3svc/1,computername=Server1 -whatif > msdeploysync.log
4. Alternatively, run the following command to do a "pull" synchronization from the remote source to the local destination (replace Server1 with your machine name):
msdeploy -verb:sync -source:metakey=lm/w3svc/1,computername=Server1 -dest:metakey=lm/w3svc/1 -whatif > msdeploysync.log
You are now done migrating 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 migrated a web site from a source IIS 6.0 server to a destination IIS 7.0 server, including viewing the dependencies, configuring the destination IIS 7.0 server and performing the migration.