I was working with one of our partner who want to migrate 30+ sites from an existing IIS6 server, to a new IIS6 server. We had an old tool IIS6 Migration Tool which would come handy, but this would be requiring 30 steps to migrate 30 websites one by one. Here comes the new tool which was specifically targeted for IIS6 to IIS7 migration, but it should help people doing a migration from a old IIS6 to a new IIS6.

In this blog, I'm taking a simple scenario where we are going to an offline upgrade. I call it an offline upgrade since we are dumping the website contents to a folder, and then by using the dump, we create sites on the destination. If you can use the msdeploy service on the destination, and the source, we can do a one-step migration of the sites. I will cover those scenarios in some of the future blogs on this topic.

Tool download link : http://www.iis.net/expand/webdeploy

After installing the tool on both the machines (source, and destination), you can use the below commands to migrate the site. This tool supports migrating all the websites at one go, but below example gives you the command for just one website which you want to test.

Before going ahead with the below command, find the website identifier of the website that you are interested in. You can easily find that by opening IIS manager, and clicking on the global “Websites” node in the left hand side panel, and you will see the website ID along with other properties in the right panel.

Commands to create an archive of the site that you want to migrate (to be executed from the source server):

Before moving the website configuration, we need to move the application pool configurations. If you are moving all the websites at one go, this separate step is not needed .

Step 1 – moving the application pool configuration

C:\Program Files\IIS\Microsoft Web Deploy>msdeploy -verb:sync  -source:metakey=lm/w3svc/AppPools -dest:archivedir=c:\AppPoolConfig,encryptPassword=testIIS

Step 2 – moving the website configuration:

C:\Program Files\IIS\Microsoft Web Deploy>msdeploy -verb:sync  -source:metakey=lm/w3svc/1 -dest:archivedir=c:\W3SVC_1,encryptPassword=testIIS

Note : I used 1 as the website identifier. Giving password is a must since the website configuration might include some password information, example IUSR user password.

Now, after creating the archive, move those two folders to the destination machine. C:\AppPoolConfig, and C:\W3SVC_1 folders.

Commands to migrate websites (to be executed on the destination server):

Step 1 – creating AppPools

C:\Program Files\IIS\Microsoft Web Deploy>msdeploy -verb:sync  -source:archivedir=c:\AppPoolConfig,encryptPassword=testIIS -dest:metakey=lm/w3svc/AppPools

Step 2 – creating the website

C:\Program Files\IIS\Microsoft Web Deploy>msdeploy -verb:sync  -source:archivedir=c:\w3svc,encryptPassword=testIIS -dest:metakey=lm

After executing these commands, if you are using a local account for the anonymous authentication (which is by default), you need to change the account name, and password after the migration. Also the above commands won’t be migrating your certificates. Check this blog which talks about migrating certificates.

Below are some articles which might help you with:

http://www.iis.net/expand/webdeploy

http://learn.iis.net/page.aspx/427/migrate-from-iis-60-to-iis-70

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

If you want to migrate the whole metabase, just change the –source: as –source:metakey=lm. This would dump all the contents of the Metabase to the archive folder. Please leave your questions in the comments section, I will try to answer as many as I can. Hope this helps!