How to export your IIS7 config from one server and import into another

UPDATE: While the post below will still work, there is a better way to do this. Please check out the Microsoft Web Deployment Tool if you need to keep your servers in sync.

http://www.iis.net/extensions/WebDeploymentTool

This tool will package registry, COM, and GAC settings. It also says that it’ll integrate with VS2010, so that your developers can package the application for easy deployment on your IIS boxes. I don’t know whether to rejoice or be scared :) Back to the original article…

I had copied the IIS7 config files from an already-configured server to a new server I was building. The two servers were going to be load balanced (non-NLB). After overwriting the config files on the new server with those that I had exported from the old server, I discovered that my app pools kept crashing. I attempted to reset the domain account credentials on the app pools, but found myself getting:

hresult:0×80090005, Message: Failed to commit configuration. Bad Data.

Built-in account works, domain accounts did not. Given that I’m much too lazy to re-configure all of the application pool IDs, I began looking for a way to gracefully import settings from the other server. Turns out, there isn’t an “import” button, so to speak. I did find that using “Shared configuration” I could essentially accomplish an import.

In IIS manager, you need to export the config from the already-configured server. In IIS manager, click the Server node, and go to Shared Configuration under Management.

IIS Shared Configuration

Click “Export Configuration

Export Configuration

Enter the path you’d like to export the config to, and set an encryption key password:

Export Configuration Settings

Copy administration.config, applicationHost.config, and configEncKey.key to your new server to a temp location.

On the new server, go back to the “Shared Configuration” section and check “Enable shared configuration.” Enter the location in physical path and click “Apply.” It should prompt for the encryption password that you had set. Enter it, and reset IIS.

Import IIS Config

After resetting IIS, go back to Shared Configuration and uncheck “Enable shared configuration.” Click apply. You should see this:

Shared Configuration Warning

Click YES and it will import all of the settings from your Shared Config into the local config on your new IIS server.

At this point, all you should need to do is change your server-specific site bindings, and it should be good to go.

8 comments to How to export your IIS7 config from one server and import into another

  • Saleh

    I am facing a serious problem after I imported the shared configuration. I browse all the websites via IIS 7 after I update binding, but I got “HTTP Error 503 – Service unavailable”. I used to create and run websites smoothly before importing configuration, Is there a way to fix this problem or at least return to the original state of IIS

  • chris

    still broken for me.

    epic fail.

    • Tom

      Define “Still broken.”

      I do this all of the time and it always works.

      As for the 503 – That’s caused by a crashed or stopped application pool. Make sure your application pool identities are correct…if they still crash, reset the passwords in the IIS config on the app pools.

  • Pedro

    I am facing a serious problem after I imported the shared configuration. I browse all the websites via IIS 7 after I update binding, but I got “HTTP Error 503 – Service unavailable”. I used to create and run websites smoothly before importing configuration, Is there a way to fix this problem or at least return to the original state of IIS

    How do I fix this? I’ve already reset the pwd in the app pool and the continues to give me the 503. pls pls help

  • Genius. This has saved me a stack of time.
    EDIT: OK, I have a massive problem with my IIS7 console now. Now that the shared (and subsequently unshared) config is loaded (or attempting to be loaded), it asked me to install a number of components for administration, which I thought was fine (I’m migrating from one DC to another before decommissioning the old DC, both running IIS7 on Server 08 – old one x86, new one x64). Now the Management Console’s gone kaput and my Event Log is filled with “Could not find file or assembly Microsoft.Web.Management.xxx” several dozen times over. Am uninstalling and reinstalling IIS Management Console but it’s no consolation (ha ha).

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">