Migrate from IIS 6.0 to IIS 7.0

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.

Comments

Is it possible part 3 step 2 should be

2. Run the following command on the source server to take an archive of the server for migration: Then copy the archive file to the destination server.

instead of destination server - I am new at that but wouldn't doing both steps on the destination server be putting the same server on top of itself

What am I missing - probably something sense no one else has commented - but I wanted clarification before trying this

Thanks

Apr 04 2008 by mrhodes

Mrhodes is right.
First: Part 3 – To migrate the site to the DESTINATION server
Then: 2. Run the following command on the SOURCE server to take an archive of the server for migration:

AND they have forgotten to remove the -whatif in step 3

Note: In this guide they are only migrating the first site lm/w3svc/1.
if you want to migrate the hole server use lm/w3svc instead.

This is what I experienced when using this guide.

But nice work, and nice tool.

Aug 25 2008 by norphf

C:\Program Files\IIS\Microsoft Web Deploy>msdeploy -verb:migrate -source:webserver60,computername=SERVER01,includeAcls=TRUE -dest:webserver60 -whatif > msdeploy_test.log

I am trying to gage someone elses experience with the migration process. I ran the above command and now I have this large log file: Example

Action: Adding child metaProperty (/LM/W3SVC/AspEnableAspHtmlFallback)
Action: Adding child metaProperty (/LM/W3SVC/AspKeepSessionIDSecure)
Action: Adding child metaProperty (/LM/W3SVC/AspLCID)
Action: Adding child metaProperty (/LM/W3SVC/AspMaxRequestEntityAllowed)
Action: Adding child metaProperty (/LM/W3SVC/AspQueueTimeout)
Action: Adding child metaProperty (/LM/W3SVC/AspScriptErrorSentToBrowser)
Action: Updating metaProperty (/LM/W3SVC/AuthFlags)
Action: Adding child metaProperty (/LM/W3SVC/130010)
Action: Adding child metaProperty (/LM/W3SVC/130008)
Action: Adding child metaProperty (/LM/W3SVC/130004)
Action: Adding child metaProperty (/LM/W3SVC/130003)
Action: Adding child metaProperty (/LM/W3SVC/CGITimeout)
Action: Updating metaProperty (/LM/W3SVC/DirBrowseFlags)
Action: Adding child metaProperty (/LM/W3SVC/LogExtFileFlags)
Action: Adding child metaProperty (/LM/W3SVC/LogInUTF8)
Action: Adding child metaProperty (/LM/W3SVC/6269)
Action: Updating metaProperty (/LM/W3SVC/AnonymousUserName)
Action: Adding child metaProperty (/LM/W3SVC/AnonymousUserPass)

Should I be getting some kind of error if there is an issue?

Jan 21 2009 by reedcd3231

Is it possible to use msdeploy to migrate an IIS 6 server running on Windows Server 2003 32bit to IIS 7 running on Windows Server 2008 x64?

I have tested from IIS 6 on W2k3 32bit to IIS 7 on Wk28 32bit and it works beautifully.

Jun 18 2009 by superiorits

I'm migrating a hundred websites from IIS 6 on W2k3 32 bit to IIS 7 on Wk208 64 bit. The sites were created but when I try to adjust the configuration like bindings or log files I get errors.

\\?\C:\Windows\system32\inetserv\config\applicationHost.config Error:

Jul 13 2009 by davidbranka@yahoo.com

You might get
Error: The property 'value' is marked as secure. An encryption password must be
specified in order to deploy this property.

For which you need to follow the following.
http://forums.iis.net/t/1157202.aspx

Jul 20 2009 by AntonOfTheWoods

Is it possible to export all the IIS settings only from a server running IIS 6 to one running IIS 7 that are not networked? If so how is this achieved?

Jul 27 2009 by jimmyuk

I'm migrating a site from server A IIS6 to server B IIS 7. When i restore the site on IIS7. How do i know wich number i can take? In this example it restores to lm/w3svc/1 but how do i know that it is free (i already have sites on this server).

Jul 28 2009 by francky88

I need some help.

Source IIS6 Windows 2003 32bit
Destination IIS7 Windows 2008 64bit

On source I started the Web Deployment Agent Service, and changed it's Log On to Administrator.

Running:
C:\Program Files\IIS\Microsoft Web Deploy>msdeploy -verb:sync -source:dirPath=C:
\www\WebSite -dest:dirPath=C:\www\WebSite,computername=xxx.xxx.com,userName=Administrator,password=xxxPasswordxx -whatif > msdeploysync.log

Output:
Error: Request to remote agent URL 'http://xxx.xxx.com/MSDEPLOYAGENTSERVICE' failed.
Error: The remote server returned an error: (400) Bad Request.
Error count: 1

On the source machine if I got to http://xxx.xxx.com/MSDEPLOYAGENTSERVICE I get prompted for user and password and then get a finished blank page. Same thing happens when I try migrate instead of sync.

Any ideas?

Jul 30 2009 by Tevyn

FYI -- I was having some trouble with RC1 hanging during mid-sync during a ‘push’ sync from my source (IIS6 x86) to the target (IIS 7 x64). It seemed to always hang on metadata updates on the target. I installed the official release today (x86 for my 2003 server/x64 for my 2008 64 bit server) and the sync completed successfully. Just a heads-up for anyone else out there who may be struggling with RC1 or early releases. Very nice tool...

Sep 25 2009 by chrisrosin

I am having an issue migrating from 6 to 7. I have successfully moved single sites in the past, but all of a sudden now everytime I run the following command, the whatif output shows that its basically trying to migrate the entire webserver, rather than the single site (using the site identifier). I can't think of what I'm doing wrong here:

msdeploy -verb:sync -source:metakey=lm/w3svc/SITEID -dest:metakey=lm/w3svc/SITEID,computername=COMPUTERNAME -replace:objectName=metaProperty,match="D:\\inetpub",replace="E:\Inetpub\wwwroot" -whatif > c:\temp\msdeploysync.log

Oct 07 2009 by gfrisina

Submit a Comment

You must Log In to comment.

Microsoft Communities