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...

38 Responses

  1. LarryLog says:

    click the next web page

  2. Arianne says:

    It’s actually a cool and useful piece of information. I am happy that you shared this helpful information with us.
    Please stay us informed like this. Thank you for sharing.

  3. replicamagic says:

    it is a fine statement

  4. Starla says:

    That is a very good tip especially to those new to the blogosphere.
    Short but very accurate information… Many thanks for sharing this
    one. A must read article!

  5. Marcel says:

    I all the time emailed this webpage post page to all my friends,
    as if like to read it next my friends will too.

  6. Harvey says:

    Hello, I want to subscribe for this website to take most
    recent updates, so where can i do it please help out.

  7. Jerome says:

    Hi Dear, are you truly visiting this website regularly, if so afterward you will absolutely take pleasant know-how.

  8. nnrolex com says:

    awesome article

  9. Aegean College says:

    Having read this I believed it was really enlightening.
    I appreciate you spending some time and energy to put this information together.
    I once again find myself personally spending a significant amount of
    time both reading and commenting. But so what, it was still worthwhile!

  10. 0mniartist says:

    Thank you for sharing your thoughts. I really appreciate your efforts and I will be waiting for your further write ups thank you
    once again. 0mniartist asmr

  11. 0mniartist says:

    Hello, I wish for to subscribe for this weblog to get hottest updates, thus where
    can i do it please assist. 0mniartist asmr

  12. 0mniartist says:

    Nice post. I used to be checking continuously this weblog and I’m impressed!
    Very useful info specially the closing part 🙂 I maintain such info a lot.
    I used to be looking for this certain information for a very lengthy time.
    Thanks and best of luck. asmr 0mniartist

  13. 0mniartist says:

    I read this post completely on the topic of the resemblance of most up-to-date and earlier technologies, it’s amazing article.
    asmr 0mniartist

  14. 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

  15. 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.

  16. Clement says:

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

  17. froleprotrem says:

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

  18. 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!

  19. Durgesh says:

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

  20. zortilo nrel says:

    Utterly indited content material, Really enjoyed reading.

  21. 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?

  22. 2020 says:

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

  23. Ruth says:

    Very informative blog article.Much thanks again. Fantastic.

  24. Tracey says:

    I really like the design and contents of your web page

  25. hard says:

    You produce quality content, congratulations on this

  26. jamika synan says:

    I am thinking of visiting your website again Thanks

  27. dovie sausedo says:

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

  28. jonah fernatt says:

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

  29. valeria rannels says:

    You have a quality site, I congratulate you on this

  30. horacio grueser says:

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

  31. leisa friederich says:

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

  32. danilo rubiano says:

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

  33. willette mcmillian says:

    Awesome article post.Much thanks again.

  34. filmi full izle says:

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

  35. izle says:

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

  36. film says:

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

  37. altyazili says:

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

  38. 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.

Leave a Reply

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