I need a solution to fully backup my IIS configuration (all Parts of IIS like all sites and application pools) on windows 2016 server and 2019 server, and store them in a specific folder, do you have any idea in order to do that?
thanks
Backup of website data and configuration running on the Internet Information Service web server consists of several steps:
Using appcmd, create IIS configuration backup on first server. To do it, run the command prompt with the administrator privileges and go to the following directory:
cd c:\Windows\system32\inetsrv
Create the IIS configuration backup with name srviis1-backup-20161107:
appcmd add backup srviis1-backup-20161107
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 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
Recover IIS configuration from this backup:
appcmd restore backup srviis1-backup-20161107
The string Restored configuration from backup “srviis1-backup-20161107″ means that IIS configuration has been successfully recovered.
Note. There are entries like BACKUP “CFGHISTORY_0000000001” in the list of available backups. These are IIS configuration backups created automatically and located in \inetpub\history. Automatic backup has appeared in IIS since IIS 7: the changes in ApplicationHost.config are being monitored, 10 latest backups are stored and the file is checked for changes every 2 minutes.
The list of restrictions and important issues.
Here you can refer to:How To Backup and Restore IIS configuration to Another Server