Windows 2022 WSUS Post-Install Error

Error complete:
Fatal Error: The schema version of the database is from a newer version of WSUS than currently installed. You must either patch your WSUS server to at least that version or drop the database.

Solution:

  1. Go to C:\Program Files\Update Services\Database
  2. Take ownership of VersionCheck.sql from “TrustInstall”
  3. Open file in notepad
  4. On line 3 change “DECLARE @scriptMinorVersion int = (11)” to “DECLARE @scriptMinorVersion int = (51)”
    the “11” is a typo
  5. Restore ownership, if cant the make “Everyone” owner
  6. Re-run post install config

 

Solution 2:

Run this in powershell:

Start-Process takeown.exe -ArgumentList '/f "C:\Program Files\Update Services\Database\VersionCheck.sql"' -Wait
Start-Process icacls.exe -ArgumentList '"C:\Program Files\Update Services\Database\VersionCheck.sql" /grant "administrator:(F)"' -Wait
(Get-Content "C:\Program Files\Update Services\Database\VersionCheck.sql") -replace "(^DECLARE @scriptMinorVersion\s+ int = \(11\)$)","DECLARE @scriptMinorVersion int = (51)" | Set-Content "C:\Program Files\Update Services\Database\VersionCheck.sql"