2

I have a number of applications currently running on a Windows Server 2003 system. We'd like to migrate one of those applications to IIS7 on a Windows Server 2008 R2 box. This is a new web server, has IIS installed, but nothing else.

I know how to migrate the entire server, and even the entire site, but how do I migrate the server-wide settings, the site-wide settings, the app pool used by the application and then the application itself?

2
  • Higly depends on the application itself. Classic ASP? ASP.NET? Something else entirely? Multiple Authentication providers? and so on etc. Feb 21 '12 at 21:10
  • Sorry for the lack of detail. The application is a simple ASP.NET MVC 2 application with its own forms-based authentication. Very simple. It is currently running on .NET 4.0. Feb 21 '12 at 23:55
4
+125

The basic answer is: Use the Web Deployment Tool.

You'd use something like

msdeploy -sync -source:metakey=lm/w3svc/1 -dest:package=c:\backupSite.zip -enableLink:AppPool

(Where 1 is the IIS site identifier) on the source machine, and then the same thing in reverse on the target:

msdeploy -sync -source:package=c:\backupSite.zip -dest:metakey=lm/w3svc/1

While you're restoring it to an IIS7 server, you still need to use the same restoration target type as was specified as the source (i.e. metakey).

You can add -whatif to the end to view what it's planning to do.

More here: http://technet.microsoft.com/en-us/library/ff633422(v=WS.10).aspx

and here: http://learn.iis.net/page.aspx/427/migrate-a-web-site-from-iis-60-to-iis-7-or-above/

4
  • Unfortunately, this deploys the server and all of the sites, not just the one site. Is there a way I can avoid creating all of the sites in the target server? Feb 29 '12 at 16:11
  • No, it doesn't, it just migrates the site (i.e. IIS Web Site object) with identifier 1. If you're not referring to an IIS Website (i.e. a top-level name binding) as a site, but an application, virtual directory, subfolder etc, you can do that too - just specify the metabase path to that "site" (lm/w3svc/1/subsite/).
    – TristanK
    Mar 1 '12 at 1:09
  • I was in fact referring to /lm/w3svc/1. I wanted all of the server-level settings, the site "Default Web Site", and the one application. Mar 1 '12 at 1:26
2

Here is the command that just got through working for me:

msdeploy -verb:sync 
         -source:metakey=lm/w3svc/1,computerName=original,encryptPassword="pwd",includeAcls=true 
         -disableLink:ContentExtension 
         -dest:package=original.zip,encryptPassword="pwd" 
         -enableLink:AppPool 
         -skip:WebApplication="^.*$"  >original.log

After this, I then deployed the application itself from the latest web deploy package.

I had a few problems. At first, when I clicked the "Default Web Site" in IIS Manager, I got an error that application "/" was not defined. I needed to set the site directory to D:\inetpub\wwwroot.

Also, the above command accurately migrated the IP address of the original server. It was necessary to edit the bindings to use the correct IP address.

Other than that, everything looks good right now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.