11/6/2009 5:11:19 PM
We added a new server at work and I needed to move all of my websites from Windows Server 2003 running IIS 6 to Windows Server 2008 running IIS 7. I was dreading the thought of having to move the files and recreate all of the websites and their virtual directories by hand. Luckily Microsoft released their Web Deployment Tool and I was able to dig up enough information the night before the migration to make it very painless.
You'll need to install the Web Deployment Tool on both servers. Get the tool using the Microsoft Web Platform Installer
Here is command I used to backup the configuration of all websites and their virtual directories on my IIS 6 server:
msdeploy -verb:sync -source:webserver60 -dest:archiveDir=<path to archive to>,encryptPassword=<password> -disableLink:contentExtension
After I had the archive created, I copied all of the physical assets of the websites to the new server (mine stayed in the same physical path so that helped ease the pain). I decided to archive my settings and move the files manually. You can just have the tool copy everything for you, but I went this route because I needed to take the existing server down right away.
After all files were in place on the new server, I ran this command to populate IIS 7 with the configuration for my sites:
msdeploy -verb:sync -source:archivedir=<path to archive>,encryptPassword=<password set in previous command> -dest:webserver60
Everything went very smoothly for me. The only issue that I ended up having was that my virtual directories that got imported into IIS 7 did not have Scripting enabled in their Handlers Mappings, which cause my redirects not to work. The problem is resolved by clicking on the virtual directory, going to Handler Mappings, clicking Edit Feature Permissions and ensuring that Scripting is checked.
Thanks to Microsoft for creating these tools that save us all a lot of headache.
Tags:IIS 81bb1518-82d8-47d8-9616-f80533a36af4