IIS export import configuration

IISWhen using multiple IIS server in a Load Balanced Environment it will  be alot of work to create all your website twice with the same settings on each webserver. Therefor it is possible to export and import your configuration from one IIS webserver to the other.

When you create a website in IIS a unique application pool will also be created and used by this website, that’s why you need to import these application pools first on the second webserver before importing the website(s).

Export all Application Pools from IIS

This command will export all IIS application pools to xml file.

Therefore you need to edit the apppools.xml and remove the application that you do not need to import for example:

  • DefaultAppPool
  • Classic .NET AppPool
  • SecurityTokenServiceApplicationPool

And other apppools that already exist on the second webserver, appcmd doesn’t skip already existing apppools, it just quit’s and doesn’t import any.

Import all Application Pools to IIS

All the AppPools in the xml will be created on your second webserver.

Export all IIS websites

This command will export all IIS websites to xml file, therefor you need to edit the sites.xml and remove the websites that you do not need to import for example “Default Website”

And all other websites that already exist on the second webserver.

Import all websites to IIS

It’s also possible to export a single website or application pool . All you need to do is add the name of the Application Pool or Website to the command line:

Export a single application pool from IIS

Import a single application pool to IIS

 

Export a single website from IIS

 

Import a single website to IIS

 

Good luck!

Want me to do this for you? Drop me a line: itgalaxyzzz {at} gmail [dot] com