Recently got chance to work on migrating hosted sites on IIS 6.0 to IIS 7.0. As documentation is not available and need transfer sites without any configurations and dependencies documentation. I searched on net about automatic transfer from IIS 6.0 to IIS 7.0. I got Microsoft Web Deployment Tool.
This will help you migrate a Web site from IIS 6.0 to IIS 7 or above by using the Web Deployment Tool. Here I try to merge few require information from Microsoft and other various blogs.
This will help you for:
- How to get dependencies of sites using command
- Export current site(s) into Package(s)
- Setup Sites on new Internet Information Server with its application pool.
PREREQUISITES
This guide requires the following prerequisites:
- .NET Framework 2.0 SP1 or greater
- Web Deployment Tool 2.0
1. Installing and Configuring Web Deploy
Install Web Deploy V3 RC using WebAPI 4 RC
Web Deployment Tool
Reference: Web Deployment Tool Installation
2. 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>
Here <1> is site id.
Find out SiteID in iis5/6.
In IIS 5 or 6, view the properties of the website and in the Web Site tab, click on the Properties button for the logging. At the bottom of the Extended Logging Properties window is the Log file name. It will be something like this: W3SVC10000\exyymmdd.log. The SiteID is 10000 in this case.
[Ref: http://weblogs.asp.net/owscott/archive/2005/07/29/421058.aspx%5D
2. Compile a list of dependencies and require component.
References: Viewing Dependencies
3. CONFIGURE THE TARGET
Take the list items (dependencies and component) created in 2.2. And configure your server based on that
4. MIGRATE YOUR SITE TO THE TARGET BY USING A PACKAGE FILE
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.
%windir%\system32\inetsrv\appcmd add backup “PreWebDeploy”
2. Run the following command on the source server to create a package (compressed) file of the server:
msdeploy -verb:sync -source:metakey=lm/w3svc/1 -dest:package=c:\Site1.zip > WebDeployPackage.log
3. Take Application Pool setting into package adding following option into MSDeploy.
- enableLink:AppPoolExtension
Example: msdeploy -verb:sync -source:metakey=lm/w3svc/1 -enableLink:AppPoolExtension -dest:package=c:\Site1.zip > WebDeployPackage.log
4. If your source site is set for SSL Certificate. You need to add following option to your command.
,encryptPassword=[pass]
Example: msdeploy -verb:sync -source:metakey=lm/w3svc/1 -enableLink:AppPoolExtension -dest:package=c:\Site1.zip,encryptPassword=[pass] > WebDeployPackage.log
5. Copy the package file to the destination server.
6. Run the following command on the destination server to validate what would happen if a sync operation were run:
msdeploy -verb:sync -source:package=c:\Site1.zip -dest:metakey=lm/w3svc/<1> -whatif > WebDeploySync.log
Please change <1> to your SiteID for Destination Server. If IIS has site with sameID it will replace site with new source.
5. After verifying the output, run the same command again without the whatif flag:
msdeploy -verb:sync -source:package=c:\Site1.zip -dest:metakey=lm/w3svc/1 > WebDeploySync.log
Original Article: Migrate a Web Site from IIS 6.0 to IIS 7 or above