IIS (Internet Information Services) · Advanced Operations

Configuration Backup and Restore

One wrong click in IIS Manager can break every site. A configuration backup restores everything in seconds.

Advanced 5 min Lesson 44 of 45Covers IIS 10 on Windows Server 2019/2022/2025 and Windows 10/11.
0/45 in IIS
On this page · 5 min · Advanced

Learning objectives#

  • Know where IIS stores its configuration
  • Use the automatic configuration history
  • Create and restore named backups
  • Copy configuration to a new server

Explanation#

Server-level configuration lives in %windir%\system32\inetsrv\config (applicationHost.config, administration.config, redirection.config). Site settings may also live in each site’s web.config, which belongs with the site’s files.

IIS keeps an automatic history: every 2 minutes, if the configuration changed, a copy goes to %SystemDrive%\inetpub\history\CFGHISTORY_xxxxxxxx (10 copies by default).

Before any big change, take a named backup: appcmd add backup "before-ssl-change". appcmd list backup shows them; appcmd restore backup "name" puts one back (IIS restarts its services).

To move to a new server, Web Deploy (msdeploy -verb:sync -source:webServer) copies configuration and content; or export with Shared Configuration’s Export and import carefully — machine keys and certificates must move too.

Step-by-step screens#

Drawings of IIS Manager in IIS 10 (Windows Server 2019/2022, Windows 10/11). The red numbers match the numbered actions under each picture; names on your computer will differ.

Loading pictures…

Code example: Named backup, change, restore#

PowerShellNamed backup, change, restore Illustrative
$appcmd = "$env:windir\system32\inetsrv\appcmd.exe"
& $appcmd add backup "before-ssl-change"
& $appcmd list backup


# ...a change goes wrong...


& $appcmd restore backup "before-ssl-change"


# PowerShell equivalent
Import-Module WebAdministration
Backup-WebConfiguration -Name 'nightly-2026-11-26'
Get-WebConfigurationBackup | Select-Object Name, CreationDate
Expected output
BACKUP object "before-ssl-change" added
BACKUP "CFGHISTORY_0000000012"
BACKUP "before-ssl-change"
Restored configuration from backup "before-ssl-change"

This example is illustrative. Copy or download it and run it in your own environment; the expected output is shown above.

Step-by-step explanation#

  1. add backup copies the config folder under inetsrv\backup\before-ssl-change.
  2. list backup shows named and automatic history backups.
  3. restore backup puts the files back and restarts IIS services.
  4. Backup-WebConfiguration does the same from PowerShell.

Real-world use case#

An admin removed the wrong binding during a certificate change and three sites went down. appcmd restore backup "before-ssl-change" brought them back in 15 seconds.

Common mistakes#

Relying only on automatic history

It keeps 10 copies; a busy day of changes pushes the good one out. Take named backups before risky work.

Restoring on another server

Encrypted passwords use machine keys; a config restored elsewhere can fail to decrypt. Use Web Deploy or Shared Configuration export.

Best practices#

  • Named backup before every change
  • Include config folder in server backups
  • Keep web.config in source control
  • Document certificates and machine keys

Remember this#

Config: inetsrv\config.

History: inetpub\history.

appcmd add/list/restore backup.

Practice exercise#

Your task: Create a named IIS configuration backup called pre-upgrade.

Show solution
PowerShell Illustrative
& "$env:windir\system32\inetsrv\appcmd.exe" add backup "pre-upgrade"

Mini quiz#

Configuration Backup and Restore quizMultiple choice Question 1 of 1

Where does IIS keep its automatic configuration history?

Score so far: 0/0

Want more? Practise all IIS MCQs · IIS interview questions

My notes#

Saved in this browser.

Progress is saved in this browser. Sign in to sync.