Backup IIS10 using Powershell Command
In this blog, we will show you how to backup IIS10 using PowerShell command.
- Virtual Machine
BACKUP IIS CONFIGURATION
- To backup IIS metabase and its related configuration files, Login into the VM and make sure IIS is installed. Type inetmgr in the Run window.
Note : We are using the Default Web Site as only site for this demo.
- Open PowerShell window and type the below command to backup IIS configuration settings.
Syntax: Backup-WebConfiguration <backup filename>
Example: Backup-WebConfiguration IISBackup
- This command will backup only the IIS configuration files, not the website files. By default, the backup will save in c:\Windows\System32\inetsrv\backup folder.
- Inside IISBackup folder we will see the IIS configuration files.
- We can also schedule this command in windows scheduled tasks to run at regular intervals.
WINDOWS BACKUP FOR WEBSITE FILES
- Once the IIS configuration backup is complete, we can use the inbuilt Windows Backup feature to backup the IIS website files. First, make sure that windows backup feature was installed on the server.
- Open the windows backup feature through server manager snap-in.
- From the Windows Server Backup snap-in, Click on Backup Once option.
- Once the Backup Once wizard opens, Select the Different Options button and click next.
- Select the Custom option and click Next.
- In this screen, Click on Add items button to add the IIS website(s) and IIS configuration(s) files in the list.
- Add the IIS websites files folder (By default it will c:\inetpub\wwwroot) and IIS configuration backup folder c:\windows\system32\inetsrv\IISBackup.
- Select the type of storage and click Next. In this Demo, we select e:\ drive.
- Click on the Backup button to start the backup for the selected files.
- It will take several minutes to complete the backup.
Thanks for reading this blog. We hope it was useful for you to learn to take IIS10 backup through PowerShell command.