IIS Configuration Restore


If you’ve ever made a change in IIS and then your websites stop loading, you quickly start looking for a way to restore your last config. Luckily IIS7 introduced a feature called Configuration History that automatically backs up your config when it detects a change. Here’s how to make use of those backups and perform an IIS Configuration Restore, as well as how to manually backup your configuration.

IIS Configuration History

IIS7 introduced a feature called IIS Configuration History. The feature monitored the applicationhost.config, and when a change was about be written to the config, it would create a backup of applicationhost.config. Those backups are stored in C:\inetpub\history and regular flat files. IIS keeps the last 10 copies in this directory, and rolls off the older ones. So even though this is a very helpful feature, if you’re planning to do a lot of changes in IIS you should create a manual backup. Your manual backups will not be rolled off automatically.

IIS Configuration Backup

Creating a manual IIS Configuration Backup is also fairly easy. If you’re planning to make some major changes, I would recommend taking a manual backup as part of your backout plan.

1. From the command line, change to the inetsrv directory.

cd %windir%\system32\inetsrv\

2. Create the backup using appcmd

appcmd.exe add backup "My Backup Name"

IIS Configuration Restore

Restoring a Configuration Backup is pretty simple using appcmd.exe.

1. From the command line, change to the inetsrv directory.

cd %windir%\system32\inetsrv\

2. List the available backups

appcmd.exe list backups

IIS Configuration Restore


Alternatively you can view the backed up applicationhost.config files in c:\inetpub\history using Windows Explorer.IIS Configuration Backups


3. Restore the desired configuration backup

appcmd.exe restore backup "My Backup Name"

4. You will need to restart IIS Manager to see the restore, but you do not need to restart IIS.



Using Configuration History with IIS 7 and IIS 8

My New Stories

March 2016 Web Hosting Deals
Powershell AD Group Management
Troubleshooting 403