Estoy involucrado en un proyecto de migración de websites desde una plataforma IIS5 e IIS6 a otra con IIS7.5, vamos de Windows 2000 y Windows Server 2003 a una Windows Server 2008R2, de x32 a x64. Me centraré en la migración de IIS6 a IIS7 porque como sabreis Windows 2000 ni está soportado ni nada de nada, aunque haya cienes y cienes de ellos todavía funcionando.
Buscando en el portal IIS.Net encontré el Web Platform Installer 3.0 que instalé y, sobre todo, varias herramientas que contiene y que me vienen como anillo al dedo :
- Web Deployment Tool.- para el despliegue de Sites.
- Web Farm Framework.- para la creación de una granja de publicadores.
También en este portal descubrí un procedimiento de migración muy sencillo que ahora os resumo:
Tipo de migraciones que podemos realizar con esta herramienta:
- Migrate 1 or 1,000 Web sitesfrom IIS 6.0 to IIS 7 including all the configuration settings, content andcertificates
- Migrate a single application
- Migrate an entire server(all Web sites, application pools, etc.) from IIS 6.0 to IIS 7
- Migrate a custom manifestcomprised of sites, application pools, assemblies, COM objects, registry keys,content and more from IIS 6.0 to IIS 7
Preprequisitos:
- .NET Framework 2.0 SP1 osuperior.
- Web Deployment Tool 1.1
Migración:
- Part 1 – View your site’sdependencies
1. Get the dependencies of the Web site by running the followingcommand: msdeploy-verb:getDependencies -source:metakey=lm/w3svc/1
2. Review the output of the dependencies and look for any scriptmaps or installed components in use by the site. For example, if WindowsAuthentication is in use by the Web site, you will see <dependencyname=»WindowsAuthentication» />.
3. If your site is inheriting any script maps, these will not belisted in the dependencies and you should also review the script maps for yoursite manually.
4. Compile a list of the components needed on the destination.
- Part 2 – Configure thetarget
1. Review the list of dependencies and install them on thedestination server.
For example, let’s assume you had the following in use for yourWeb site:
· ASP.NET
· Windows Authentication
· Anonymous Authentication
Based on this analysis of your dependencies, you would installthe corresponding components and modules.
- Part 3a – Migrate your siteto the target by using a package file
1. Always make a backup of the destination server. Even if youare just testing, it allows you to easily restore the state of your server.
%windir%system32inetsrvappcmd add backup “PreWebDeploy”
2. Run the following command on the source server to create apackage (compressed) file of the server:
msdeploy -verb:sync -source:metakey=lm/w3svc/1-dest:package=c:Site1.zip > WebDeployPackage.log
3. Copy the package file to the destination server.
3. Run the following command on the destination server tovalidate what would happen if a sync operationwere run:
msdeploy -verb:sync -source:package=c:Site1.zip-dest:metakey=lm/w3svc/1 -whatif > WebDeploySync.log
4. After verifying the output, run the same command againwithout the whatif flag:
msdeploy -verb:sync -source:package=c:Site1.zip-dest:metakey=lm/w3svc/1 > WebDeploySync.log
- Part 3b – Migrate your siteto the target by using the Web Deployment Agent Service
If you don’t want to use a package, you can use the WebDeployment Agent Service (MsDepSvc, also called «remote service») tosynchronize from IIS 6.0 to IIS 7.
1. Install the remote service on either the source or thedestination depending on whether you want to synchronize from a remote sourceor to a remote destination.
2. Start the service on the computer.
net start msdepsvc
3. Run the following command to do a «push»synchronization from the local source to a remote destination (replace Server1 withthe name of the remote computer). Run the command first with the whatif flag,then without it once you have confirmed that the command will do what you want.
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 localdestination (replace Server1 with the name of the remote computer). Run thecommand first with the whatif flag, then without it once you have confirmedthat the command will do what you want.
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 browsingto the web site on the destination server. For troubleshooting help, see Troubleshooting Web Deploy.
Pues, manos a la obra. Ejecutamos los siguientes comandos desde nuestro servidor W2K8R2IIS y después de unos minutos nos aparece el nuevo Site:
Depende de la programación y configuración del Site de origen el que funcione a la primera. Yo, de todas maneras, realizó un chequeo oportuno:
- Verificar los Bindings.-
- Verificar los Applications Pools.-
- Importar Certificados.- En el caso de que proceda.
- Verificar el tipo de autenticación.- En mi caso me pedía usuario y password al conectarme aunque tuviese Autenticación Anónima. Tuve que seleccionar «Application pool identity».
- Igualar permisos.- Ya sea con un robocopy, un SubinAcl o un Icacls.
Bibliografía.