In this blog, we will learning how we can export IIS application pools and websites and import them to another IIS webserver.
Let’s start 🙂
Step 1- Export application pools
Open command prompt (CMD) as administrator and type below command%windir%\system32\inetsrv\appcmd list apppool /config /xml > c:\apppools.xml
This will export all application pools to xml file c:\apppools.xml, you can edit the apppools.xml and remove the application that you do not need to import like default application pool etc.
Step 2- Export sites
Type below command in cmd and press enter%windir%\system32\inetsrv\appcmd list site /config /xml > c:\sites.xml
This will export all the websites on your webserver, therefor you need to edit the sites.xml and remove the websites that you do not need to import like default website.
Step 3- Import application pool
Go to your destination server/computer and open command prompt as administrator.
Type below command in cmd and press enter%windir%\system32\inetsrv\appcmd add apppool /in < c:\apppools.xml
All the Application Pools in the xml will be created on your destination computer.
Step 4- Import websites to server
Go to your destination server/computer and open command prompt as administrator.
Type below command in cmd and press enter%windir%\system32\inetsrv\appcmd add site /in < c:\sites.xml
Cheers! Now all your application pools and websites are also imported to new server/computer.