How To Restore Windows Server Update Services From Backups

by | Last updated 2024.09.03 | Published on 2022.11.09 | Blog, Guides, WSUS

You probably already know that backing up your Windows Server Updates Services is crucial. You want to back up because restores are faster than rebuilding WSUS. Although it’s not difficult to rebuild, it takes valuable time we know you don’t have. Your WSUS configuration includes the approval status of your updates and WSUS synchronization settings – all of which you won’t have to reconfigure should your WSUS server crash.

When you need to restore from a previous backup, you’ll have to choose a specific backup you want restored, and you must also have a valid backup file. There are various reasons why you would restore from a backup, and that will affect your choice of backup you use. Don’t worry, we’ll help you learn everything you need to know about restoring Windows Server Update Services (WSUS) from backups.

How to Restore the WSUS Database

Graphical

1. Open SSMS and connect to the database instance being used for WSUS. If connecting to the WID, open SSMS using “Run as administrator” or the connection will not work.

sql server

 

2. Expand Databases and right click on SUSDB (the default name for the WSUS Database) and choose Tasks > Restore > Database…

instructions restoring WSUS

a. If you are using WID, you likely will encounter an error “Property BackupDirectory is not available for Settings ‘Microsoft.SqlServer.Management.Smo.Settings’. This property may not exist for this object, or may not be retrievable due to insufficient access rights.” This can also happen on other installations of SQL Server like SQL Express, SQL Standard, or SQL Enterprise.

restoring windows server update services from backup

*If this occurs, you will need to create a registry string entry named BackupDirectory and point it to: C:\Temp (or any folder that exists where you store your backups). For the WID: New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\MSWIN8.SQLWID\MSSQLSERVER" -Name "BackupDirectory" -Value "C:\Temp" -PropertyType String

 

3. Select Device as the Source and choose the backup file.

restoring WSUS from backup

 

4. Under the Backup Options page, put a checkmark in “Close existing connections to destination database” or the restore will likely fail due to the database still being in use.

restoring windows server update services from backup

 

5. Press OK and your database will restore successfully.

restoring WSUS

Command Line

1. Open PowerShell. If connecting to the WID, open PowerShell using “Run as administrator” or the connection won’t work. SQLCmd.exe should already be available to use as it should be in the global $env:Path variable.

2. Run SQLCmd with the appropriate connection to your database:

a. WID: SQLCMD -E -S np:\\.\pipe\MICROSOFT##WID\tsql\query -Q "ALTER DATABASE [SUSDB] SET SINGLE_USER WITH ROLLBACK IMMEDIATE; RESTORE DATABASE [SUSDB] FROM DISK = N'C:\Temp\SUSDB.bak'"

b. SQL Instance: SQLCmd.exe -S .\SQLServerInstance -E -Q "ALTER DATABASE [SUSDB] SET SINGLE_USER WITH ROLLBACK IMMEDIATE; RESTORE DATABASE [SUSDB] FROM DISK = N'C:\Temp\SUSDB.bak'"

Restore Your Files

Once you restore your files with permissions (or restore permissions manually), you should make sure you run

 & "$env:ProgramFiles\Update Services\Tools\WsusUtil.exe" Reset 

Then wait 24 hours because there are no notifications when this process is running or when it has finished. This will re-visit every update file within the WSUS database and ensure the files on disk are complete and not corrupted. If any files are missing or corrupted, it will attempt to re-download them from the Upstream (usually Microsoft Update).

Restoring Windows Server Update Services from Backups with WAM Saves You Time

WSUS does not have a built-in utility for backing up and restoring. Backups are done using Windows Server Backup or third party file-level solution in combination with SQL Backups or a third-party solution, like WAM. WAM uses SQLCMD.exe which is SQL’s own tool for backups. We test if compression is supported and compress the backup by default. Be advised, compression is NOT supported on SQL Express installations, but is supported on WID/SQL Standard/SQL Enterprise. WAM does NOT back up remote databases as if it is on a remote server (Express/Standard/Enterprise), there should be an SQL Aware Enterprise level backup solution being used to backup the database.

WAM can take care of your WSUS backups and restores so you can work on other things.

Easily purchase WAM online and save time on WSUS maintenance.

At AJ Tek, our vision is to make IT simple and automated for other IT professionals. Our flagship product is WAM, WSUS Automated Maintenance. This system performs all of the tasks that a WSUS Administrator needs to do to maintain WSUS properly only leaving the approving of updates and reporting to the WSUS Administrator.

Connect with us on Facebook and LinkedIn for additional insights and advice.

How To Fix WSUS Synchronization Errors

How To Fix WSUS Synchronization Errors

Sometimes WSUS has issues synchronizing with the upstream server – usually Microsoft, but it can be a local upstream server. Why these errors happen can be for many reasons.Microsoft requires several websites to be accessible through the firewall to synchronize. These...

How to Prepare for On-Prem WSUS UUP Updates

How to Prepare for On-Prem WSUS UUP Updates

Quality updates are coming on March 28 for on-premises Windows 11, version 22H2 devices. The updates are coming via the Unified Update Platform (UUP) which interoperates with WSUS and Microsoft Configuration Manager. UUP quality updates are cumulative, including all...