IdP Versions Applicable: Any
Description: creating multiple application pools is great for applications, but can be a pain to migrate due to Microsoft’s lack of IIS tools.
Resolution: utilize this script to load out the application pools and which realms belong to which application pools. Once that is done, so migrate the xml over and load in the application pools with the second command.
- In order to perform this action, there are a few steps to take. App pools are separate from the site, so first we will need to save off the app pools and bring that over to our other server and load it in.
To export app pools, please run the following from an elevated command prompt:
%windir%\system32\inetsrv\appcmd list apppool /config /xml > c:\apppools.xmlIt will look like this, with the file generated where you want to specify it.
- Next, you’ll want to export your entire default web site, so we can get each individual realm configuration. We do this by another command of similar fashion.
Please run this command on the same elevated prompt:
%windir%\system32\inetsrv\appcmd list site /config /xml > c:\sites.xmlIt will look something like this, with again, the file where you specify it.
- Once you have exported your configuration, it is time to move these two xml files over to your other server, and run these two commands to load in these app pools and default web site.
Before running the load in site command, please edit the xml to change the site value from 1 to 2. Elsewise, you’ll have a conflict loading it in.
Same applies to the app pools, please remove the ones that are existing on this current server prior to running the import commands.
%windir%\system32\inetsrv\appcmd add apppool /in < c:\apppools.xml
%windir%\system32\inetsrv\appcmd add site /in < c:\sites.xml
- Once having done so, you will now have two default web sites, go ahead and remove your original one and rename the second, respectively, to the “default web site” name. In my case here, it was Test Site, so I then remove default web site, and rename accordingly.
- Remember to open bindings and bind your old cert to the new site.
- Now that’s it! Do an iisrestart, and run through and ensure all your realms are working with their updated app pools. Remember to run through app pool permissions and such, since you have brought over new ones, especially if there are domain accounts being utilized in the app pool accounts.