IIS Backup Script

To Backup and Restore IIS configuration to Another Server you could try below steps:

1)if you configured the certificate with old iis site you need to Backup (export) of IIS certificates.

2)open the command prompt as administrator and create IIS configuration backup on the first server by using below command:

cd c:\Windows\system32\inetsrv


appcmd add backup srviis1-backup-2019

srviis1-backup-2019 this is a backup folder name.

After the command has been executed, a folder with your backup name appears in c:\Windows\system32\inetsrv\backup. Here is its contents for my simple website:

  • administration.config
  • applicationHost.config
  • MBSchema.xml
  • MetaBase.xml
  • redirection.config
enter image description here

3)Copy the backup folder to the same directory c:\windows\system32\backup on another server.

To display the list of all available backups, run the following command:

appcmd list backup
enter image description here

4)Recover IIS configuration from this backup:

appcmd restore backup srviis1-backup-2019

The list of restrictions and important issues:

  • The same IIS version has to be used on both servers
  • If any application pool is run not from the integrated accounts, they have to be available on another server as well
  • Before recovery, you should export and migrate all current certificates to the new server