I want to migrate all websites (code, db, config, SSL certs, images, data, etc) from an old Windows Server 2003 (IIS 6) to Windows Server 2008/2008R2/2012/2012R2 (IIS 7 or IIS 8).
Note: you can migrate every kink of IIS server (old and new ones) using this procedure!
Install on the source server (IIS 6) and on the destination server (IIS 7 or IIS 8) the MicroSoft Web Deploy Utility (version 3.5 tested working).
I went into troubles installing Web Deploy on Windows Server 2003 (IIS 6) using the MicroSoft Web Platform Installer, then I suggest to install on both machines the MSI package (complete installation).
Run this command on the source server:
msdeploy.exe -verb:sync -source:webserver60 -dest:auto,computername=DEST-IP,username=Administrator,password=ADMIN-PASS -whatif
If the command prompt returns 'command not found', put MSDeploy directory in path: This Pc - Property - Advanced System Settings - Environment Variables - Path - Edit - Append ';C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\', for me, then try again.
The '-whatif' option force the destination server to test the execution without writing.
If it returns 'ERROR_FRAMEWORK_VERSIONS_DO_NOT_MATCH', try again after installing the .NET Framework 3.5 (which contains also the .NET Framework 2.0 and 3.0) on the destination server...
...and than running this command on the source server:
msdeploy.exe -verb:sync -source:webserver60,machineconfig32.netfxversion=2,machineconfig64.netfxversion=2,rootwebconfig32.netfxversion=2,rootwebconfig64.netfxversion=2 -dest:auto,machineconfig32.netfxversion=2,machineconfig64.netfxversion=2,rootwebconfig32.netfxversion=2,rootwebconfig64.netfxversion=2,computername=DEST-IP,username=Administrator,password=ADMIN-PASS -whatif
The script may also return errors about Asp (you must install it manually on 2012) ...then run the same command without '-whatif' to really start the migration.
Now all virtual-hosts (files, databases, configurations, SSL certificates, etc) are synced from Widows 2003 to 2012 (or 2012 R2) automagically!