Backing up and Restoring IIS 7 Configuration

The metabase has pretty much gone away in IIS 7.  ApplicationHost.config is the root file of the IIS 7.0 configuration system. It includes definitions of all sites, applications, virtual directories and application pools, as well as global defaults for the web server settings (similar to machine.config and the root web.config for .NET Framework settings). It is also special in that it is the only IIS configuration file available when the web server is installed. Legacy compatibility for the IIS 6 metabases can be installed but they interface though an interpreter so backing them up does not function in the same way. This file is backed up as a whole unlike IIS 6 where there was an option to export individual site configurations to an XML file.

Backup Method 1 – The super easy way.
Simply copy the “C:\windows\system32\inetsrv\config” directory (and it’s subdirectories) into a backup directory somewhere. I suggest a backup tape or CD/DvD.

Backup Method 2 – Command line way
1.    Launch a command prompt. Start -> Run -> cmd
2.    %windir%\system32\inetsrv\appcmd.exe add backup “IIS_Backup”
3.    Move this backup off the system or burn it to media.

Restore Method 1
1.    Simply overwrite the data with the data in the backup directory

Restore Method 2- Command Line
1.    %windir%\system32\inetsrv\appcmd.exe restore backup “IIS Backup”

To view a list of available backups on the system via command line:
%windir%\system32\inetsrv\appcmd.exe list backup