Exporting & Importing App Pools and Websites configuration between multiple IIS instances

Sometimes we have to configure multiple web servers or migrate entire website configuration to another server. It will be a lot of work to create your entire website twice with the same settings on each web server. Therefore it is possible to export and import your configuration from one web server to the other.

We can do this command-line utility called appcmd which can effectively export the entire IIS websites & app pools configuration in xml format and also import this exported xml into another IIS instance.

AppCmd.exe is the single command line tool for managing IIS 7 and above. It exposes all key server management functionality through a set of intuitive management objects that can be manipulated from the command line or from scripts.

Some of the things you can do with AppCmd:

  • Create and configure sites, apps, application pools, and virtual directories
  • Start and stop sites, and recycle application pools
  • List running worker processes, and examine currently executing requests
  • Search, manipulate, export, and import IIS and ASP.NET configuration

We can get help for AppCmd what are the available options using /?:

  • AppCmd /?
  • AppCmd site /?
  • AppCmd config /?
  • AppCmd list apppool /?

This blog discusses simplifying the Exporting & Importing process. This will work for IIS 7, IIS 7.5, IIS 8, IIS 8.5

Export the Application Pools

We can export and import the application pools since they will most likely be used in your web sites and you won’t be able to import those without having their relevant app pool into place. Here’s the command-line.

This command will export all your application pools – including the default application pool. You have to remove those, as they will most likely be in your target IIS instance with the same name and therefore they will raise a duplicate name error, blocking the whole import. In order to avoid that, open the newly created apppools.xml file and remove the default ones such as:

  • DefaultAppPool
  • Classic .NET AppPool
  • .NET v2.0
  • .NET v2.0 Classic
  • .NET v4.5
  • .NET v4.5 Classic

Import the Application Pools

Copy the apppools.xml file to your target webserver and run the following command:

C:\Windows\System32\inetsrv\appcmd add apppool /in  < c:\apppools.xml

All Application Pool mentioned in the xml file will be created on your target IIS instance.   

Export the Websites

Export the all website with the following command:

C:\Windows\System32\inetsrv\appcmd list site /config /xml > c:\mysites.xml

Again, you’ll have to remove the default websites –  you’ll most likely have only one default website, which is Default Website – as well as any other website you don’t want to copy and/or is already existing on the target IIS instance, otherwise the import command won’t work.

Import the Websites

Just like you did with the App Pools file, copy the websites.xml file to your target webserver and run the following command:

C:\Windows\System32\inetsrv\appcmd add site /in < c:\mysites.xml

You may also like...

25 Responses

  1. Luella says:

    If you would like to get a great deal from this piece of writing then you have to apply these methods to your
    won blog.

  2. altyazili says:

    There is certainly a lot to know about this subject. I like all of the points you have made. Carie Fabio Damales

  3. film says:

    “Great, thanks for sharing this article post.Really looking forward to read more. Awesome.” Coral Molino

  4. izle says:

    Im thankful for the blog article. Really Great. Lura Hocke

  5. filmi full izle says:

    “Say, you got a nice article.Much thanks again. Fantastic.” Britt Faye

  6. willette mcmillian says:

    Awesome article post.Much thanks again.

  7. danilo rubiano says:

    It was very useful, I can say it was a useful article for me.

  8. leisa friederich says:

    Wow, great blog article.Really thank you! Really Great.

  9. horacio grueser says:

    I get very useful information on your page, I feel lucky

  10. valeria rannels says:

    You have a quality site, I congratulate you on this

  11. jonah fernatt says:

    Thanks so much for the blog post.Thanks Again. Great.

  12. dovie sausedo says:

    I read a great article with pleasure, I hope it will continue

  13. jamika synan says:

    I am thinking of visiting your website again Thanks

  14. hard says:

    You produce quality content, congratulations on this

  15. Tracey says:

    I really like the design and contents of your web page

  16. Ruth says:

    Very informative blog article.Much thanks again. Fantastic.

  17. 2020 says:

    A moment of silence for the person who cleaned this. Giuseppe Duilio Abe

  18. froleprotrem says:

    Thank you for the auspicious writeup. It in fact was a amusement account it. Look advanced to far added agreeable from you! However, how can we communicate?

  19. zortilo nrel says:

    Utterly indited content material, Really enjoyed reading.

  20. Durgesh says:

    बहुत अच्छी पोस्ट

  21. Deanne says:

    Please let me know if you’re looking for a article writer
    for your site. You have some really great posts and I believe
    I would be a good asset. If you ever want to take some of the load off, I’d love to write some material for your blog in exchange for a link back
    to mine. Please send me an e-mail if interested.
    Thank you!

  22. froleprotrem says:

    I think you have noted some very interesting details , regards for the post.

  23. Clement says:

    Highly descriptive blog, I enjoyed that a lot. Will there be
    a part 2?

  24. Roxana says:

    I was very happy to uncover this site. I want to to thank you for ones time for this particularly fantastic read!!

    I definitely liked every part of it and I have you book-marked to look at new things on your site.

  25. 0mniartist says:

    It is actually a nice and useful piece of info. I’m happy that you just shared
    this useful information with us. Please stay us informed like this.
    Thank you for sharing. 0mniartist asmr

Leave a Reply

Your email address will not be published. Required fields are marked *