Below are the steps required to move a website hosted on IIS6 to IIS7 (Internet Information Services 6 to 7). IIS7 replaces the aging metabase with a more convenient applicationHost.config which stores the configuration in XML.
Installing MS Deploy on the Source IIS6 Server
- You must have .NET Framework 2.0 SP1 or 3.5 installed on the server.
- Download the file and open it. Choose Setup Type: Typical. Be sure to use the x64 version if you have Windows 2003 x64. There is no entry in the Start Menu; you need to start the program through the command prompt. C:\Program Files\Microsoft Web Deploy\msdeploy followed by the command.
Installing MS Deploy on the Destination IIS7 Server
- Same as above. Be sure to use the x64 version if you have Windows 2008 x64.
Create a Backup of the IIS7 configuration
It is important to create a backup of the IIS7 configuration before you start. You never know when you’ll make a mistake, and restoring IIS to the default configuration without a backup isn’t fun.
IIS7 comes with the appcmd.exe command line tool, which is new for IIS7, and simplifies configuration backups immensely. It is located in the %windir%\system32\inetsrv\ folder, which isn’t in the path variables, so you’ll need to navigate to that path with the command prompt first.
- Click Start -> Run -> type “cmd” and press OK.
- At the command prompt, navigate to the %windir%\system32\inetsrv\ folder. (type “cd \” and then “cd C:\Windows\system32\inetsrv” if windows is in the default path)
- Once in the target directory, type: appcmd add backup “BackupPreMigrate”
- Press Enter. All done.
- To display a list of previous backups type: appcmd list backup
- To restore a backup, type: appcmd restore backup “BackupPreMigrate”
Verify Dependencies on Source IIS6 Server
Below is a screenshot of all the variables supported by the migrate tool. All instructions below assume you are in the C:\Program Files\Microsoft Web Deploy\ directory at the command prompt.
- At the command prompt (In the C:\Program Files\Microsoft Web Deploy\ directory), type:
msdeploy –verb:getDependencies –source:metakey=lm/w3svc/#siteidentifier
The list that is returned is fairly comprehensive as to what components are installed and available for use on the particular website. It does not, however, distinguish which components are actually in use.
Installing Required Components on Destination IIS7 Server
From the dependency list you can determine which roles need to be installed on the destination IIS7 Server. Any dependencies listed in the XML file that is saved during the migration will need to be installed on the destination server or else the migration will not complete. You can remove dependencies beforehand or from within the XML file found in the backup directory after the sync command.
- On the source IIS6 Server type:
msdeploy -verb:sync -source:metakey=lm/w3svc/# siteidentifier -dest:archivedir=c:\backup_name
Move the backup folder (c:\backup_name) to the destination server, or if on a network simply backup to the final destination on the IIS7 server or SAN.
- On the destination IIS7 Server type:
msdeploy -verb:migrate -source:archivedir=c:\backup_name -dest:metakey=lm/w3svc/# siteidentifier
After the migration is complete, some elements will need to be re-configured. PHP, ASP.NET Ajax and others will need to be configured independently of the IIS migration to match the source server’s settings.