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

44 Responses

  1. zoritoler imol says:

    I am always searching online for articles that can help me. Thank you!

  2. we buy junk cars houston no title says:

    Hello, i think that i saw you visited my weblog so i came
    to “return the favor”.I am attempting to find things to improve my web site!I suppose its ok to use a few of
    your ideas!!

  3. crorkservice says:

    Thanks again for the article.Really looking forward to read more. Great.

  4. gralion torile says:

    What i do not understood is in truth how you’re not really a lot more neatly-preferred than you might be now. You are very intelligent. You recognize thus considerably on the subject of this subject, made me individually believe it from so many various angles. Its like men and women don’t seem to be fascinated unless it?¦s something to do with Girl gaga! Your own stuffs great. At all times deal with it up!

  5. zoritoler imol says:

    I have been browsing online more than 3 hours today, yet I never found any interesting article like yours. It’s pretty worth enough for me. In my opinion, if all site owners and bloggers made good content as you did, the web will be a lot more useful than ever before.

  6. gralion torile says:

    Some genuinely nice stuff on this site, I like it.

  7. LarryLog says:

    click the next web page

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

  9. replicamagic says:

    it is a fine statement

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

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

  12. Harvey says:

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

  13. Jerome says:

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

  14. nnrolex com says:

    awesome article

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

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

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

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

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

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

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

  22. Clement says:

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

  23. froleprotrem says:

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

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

  25. Durgesh says:

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

  26. zortilo nrel says:

    Utterly indited content material, Really enjoyed reading.

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

  28. 2020 says:

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

  29. Ruth says:

    Very informative blog article.Much thanks again. Fantastic.

  30. Tracey says:

    I really like the design and contents of your web page

  31. hard says:

    You produce quality content, congratulations on this

  32. jamika synan says:

    I am thinking of visiting your website again Thanks

  33. dovie sausedo says:

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

  34. jonah fernatt says:

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

  35. valeria rannels says:

    You have a quality site, I congratulate you on this

  36. horacio grueser says:

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

  37. leisa friederich says:

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

  38. danilo rubiano says:

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

  39. willette mcmillian says:

    Awesome article post.Much thanks again.

  40. filmi full izle says:

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

  41. izle says:

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

  42. film says:

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

  43. altyazili says:

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

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