
Further to my earlier post I encountered another issue migrating sites for a client from IIS6 to IIS7. If your site uses any httpHandlers or httpModules you will need to perform these steps to migrate your web.config to include the missing configuration sections required by IIS7.
First of all I would suggest listing out all sites using AppCmd and the following command:
%systemroot%\system32\inetsrv\APPCMD list sites
Your output should be similar with the following:
SITE "Default Web Site" (id:1,bindings:HTTP/*:80:,state:Started) SITE "Site1" (id:2,bindings:http/*:81:,state:Started) SITE "Site2" (id:3,bindings:http/*:82:,state:Stopped)
Make a note of the object specific identifier in quotes as you will need this to specify the website/app whose web.config you wish to migrate.
Next you will need to run another command to perform the migration as follows:
%systemroot%\system32\inetsrv\APPCMD.EXE migrate config "object-specific-identifier/"
There is a very important point worth noting here as it caught me out for quite a while, be sure to include a trailing slash after your object specific identifier or the command will fail.
All being well your should get a message similar to this confirming the web.config has been migrated.
Successfully migrated section "system.web/httpModules". Successfully migrated section "system.web/httpHandlers".
That’s it, for me the app was back up and running again after these steps.







5 Responses
[...] This post was mentioned on Twitter by Simon Dingley, Sara. Sara said: RT @ProNotion – New blog post: Use AppCmd to Migrate web.config from IIS6 to IIS7 http://bit.ly/abICkx [...]
When i run the 2 command i’m getting below error.
C:\Users\admbpatil>%systemroot%\system32\inetsrv\APPCMD.EXE migrate config “obje
ct-specific-identifier/”
ERROR ( message:Cannot find APP object with identifier “object-specific-identifi
er/”. )
Basu, perhaps I am not clear enough in the post that you need to replace the text ‘object-specific-identifier/’ with the object identifier for the site whose web.config you want to replace? You can get the object specific identifier for the site in the first step.
Thanks for this. The last “/” was the killer.
Unfortunately I am getting Page cannot be found when setting the App Pool to integrated. But I guess that’s a differnt story.
Works great in Classic Mode.
Raz, are you using any sort of url rewriting module? If so you will most likely want to read this http://learn.iis.net/page.aspx/121/iis-7-modules-overview/#Precondition and pay particular attention to the runAllManagedModulesForAllRequests property in the section of your web.config. I will let you Google the pro’s and con’s of doing this but it’s worked for me before at least to get the site back up and running again.