IIS can be restored from backup configuration files. When doing this, the previous property settings and state are restored for all sites, application pools, applications and virtual directories. Recovering the configuration won’t repair a corrupted IIS installation. When restoring IIS from a backup configuration, the IIS command-line administration tool stops the server, copies the backup configuration files over the existing configuration files, and then restarts the server. IIS then loads the current run state from those files on startup. By using the IIS command-line tool, a configuration backup can be restored by running the Restore backup command. Optionally, AppCmd can be specified to stop the server before restoring the configuration. Because stopping and starting the server causes all server processes to be recycled, this could cause issues with eth user sessions and applications.
Use the Windows PowerShell to execute the IIS command-line tool.
1. Click Start, click All Programs, and then click Accessories.
2. Start an elevated command prompt by right-clicking Command Prompt, and then selecting Run As Administrator.
3. In the Command Prompt window, type powershell, and enter.
4. At the powershell prompt you will need to move to the C:\windows\system32\Inetsrv folder.
The appcmd command Syntax:
Appcmd restore backup [/backup.name:] ‘BackupName” [/stop:true|false]
The appcmd Usage:
Appcmd restore backup “DABackupDDMMYYYY_1”
Appcmd restore backup “DABackupDDMMYYYY_1” /stop:false
If you get the error:
Suggestion [3, General]: The command appcmd was not found, but does exist in the
current location. Windows PowerShell doesn't load commands from the current location by default. If you trust this command, instead type ".\appcmd". See "get-help about_Command_Precedence" for more details.
Then you will need to precede the Appcmd command with “.\”
.\Appcmd restore backup “DABackupDDMMYYYY_1”
.\Appcmd restore backup “DABackupDDMMYYYY_1” /stop:false
You may also review all of your IIS backups with the command listed below.
Appcmd list backup
Additionally, the backup with IIS is located in %windir%\system32\inetsrv.
Related Articles or Solutions: