How to export all application pools on iis7+:
%windir%\system32\inetsrv\appcmd list Apppool/config/xml > C:\apppools.xml
This command will export all of the application pools on the server, but some of us we don't need to erase them. For example:
- DefaultAppPool
- Classic. Net AppPool
If you find an application pool with the same name already exists at import, the import will fail.
ways to import application pools:
%windir%\system32\inetsrv\appcmd Add Apppool/in < C:\apppools.xml
This allows you to import all of your application pools to another server.
ways to export all sites:
%windir%\system32\inetsrv\appcmd list Site/config/xml > C:\sites.xml
Again, we need to edit the Sites.xml file to delete unwanted sites. For example:
ways to import a site:
%windir%\system32\inetsrv\appcmd Add Site/in < C:\sites.xml
Now that the import is done, look at the IIS configuration of the two servers.
In addition, the introduction of a separate export to import a site method
To export a separate application pool:
%windir%\system32\inetsrv\appcmd list AppPool "Application pool name"/config/xml > C:\myapppool.xml
The yellow font is the name of the application pool to export
To import a separate application pool:
%windir%\system32\inetsrv\appcmd Add apppool/in < C:\myapppool.xml
To export a separate site:
%windir%\system32\inetsrv\appcmd list site name/config/xml > C:\mywebsite.xml
The yellow font is the name of the site to export
To import a separate site:
%windir%\system32\inetsrv\appcmd Add Site/in < C:\mywebsite.xml
Appcmd Command Import Export site vs. application pool