Post

IIS Server Backup and Restore

IIS (Internet Information Services) running on Windows Server is a preferred web server platform with its reliability and wide configuration options. However, it is very important to back up IIS configurations securely and restore them quickly when necessary against risks such as configuration errors, system crashes or cyber threats. In this article, we will discuss how to perform IIS backup and restore operations and why it is a critical step.

#IIS Version Check:
#PS
get-itemproperty HKLM:\SOFTWARE\Microsoft\InetStp\ | select setupstring,versionstring
#Storage for IIS published sites [Move to new server]
C:\inetpub\
C:\inetpub\wwwroot
C:\My_Web_page\
#Storage of System files and Administrative tools required for IIS
cd %windir%\system32\inetsrv
#Backup current IIS Certificates:
**Before restoring IIS, move any SSL certificates you are using to the new server

#PS
netsh http show sslcert
netsh http show sslcertdir cert:\localmachine\my | Where-Object { $_.hasPrivateKey } | Foreach-Object { [system.IO.file]::WriteAllBytes("C:\Windows\IIS_BCK\$($_.Subject).pfx",($_.Export('PFX', 'secret')) ) }
#Management for the IIS appcmd tool:
cd %windir%\system32\inetsrv
appcmd list backup
appcmd list site
appcmd list site demo
appcmd list config
#Backup:
Appcmd add backup ANS_yedek1
#Backup-WebConfiguration -Name ANS_yedek1 [PS]

#Restore:
appcmd list backup [list backups]
Appcmd restore backup ANS_yedek1
Appcmd restore backup /stop:true ANS_yedek1 #stop IIS Service and backup
Restore-WebConfiguration -Name ANS_yedek1 [PS]

Öğrenmeye aç kalın – Be hungry to learn

This post is licensed under CC BY 4.0 by the author.