Sunday, December 14, 2025

Version upgrade of MSSQL 2012 SP4 to 2022 upgrade xprepl.dll not found!!!

 Version upgrade of MSSQL 2012 SP4 to 2022 upgrade xprepl.dll not found!!!

Objective: You were given an objective to upgrade your MSSQL from version 2012 SP4 to 2022 in place!! Scary at first place isn’t it 😊 Since most of the MSSQL DBAs don’t prefer this approach, easiest is to build a parallel instance or parallel cluster and unplug/plug or restore the db directly and finish the job 😊

Ok, so the challenge is taken, as a general practise for MSSQL db upgrade, the following information are collected…

  1. DB design, including its File layout

  2. DB version, compatibility

  3. DB parameter settings

  4. Service account details

  5. Agent Job details

  6. Features usage details

  7. Version compatibility details (OS and DB) for the upgrade

  8. DBCC checkdb

Db config:

  1. AG (2 node replica)

  2. CDC job is configured

Post a full backup of the db, the setup.exe from 2022 binary was kicked off choosing the “Upgrade from a previous version of SQL Server”, on clicking next, the screen rolls over, prechecks and then to final confirmation message asking to confirm upgrade. Confirmed and eyes glued to the screen to see a successful

  1. Message #1 – supply me the MSODB17 binary, we can supply that by downloading the binary

  2. Message#2 – reports your MSSQL upgrade failed (timed out waiting for SQL Server to come online) 

Further examination on error log reports below…

Could not load the DLL xprepl.dll, or one of the DLLs it references. Reason: 2(The system cannot find the file specified.).


On clicking “OK”, the upgrade screen runs for completion with its ask to perform a server reboot. You will notice “Database engine upgrade failed” message in upgrade summary.

You can read more info here https://learn.microsoft.com/en-us/answers/questions/2109340/issue-with-sql-server-updates-missing-xprepl-dll

On server reboot, you see your MSSQL Server coming online fine without any manual intervention. The system dbs are online with compatibility (160) set to the version matching 2022. No impact to any agent jobs, AG is replicating fine (you cant read though now, even if you have allowed all connections).

So what really was impacted?

Agent didn’t get upgraded!!!

In such situation, what should we do?

  1. Complete first CU application, current CU level 22 for 2022

  2. Repair the SQL server installation by running setup.exe again, this should fix agent version upgrade.

Cause: A bug which isn’t fixed until CU6 in 2022.

https://learn.microsoft.com/en-us/troubleshoot/sql/releases/sqlserver-2022/cumulativeupdate6#2442348


Note the xprepl.dll isnt found in 2012 SP4 or 2022 CU22 or base 2022 version binaries. It is a mystery why MSSQL reports this issue in place MSSQL upgrade.


No comments:

Post a Comment

MSSQL 2016+ Auto seeding feature on AG

  Fixing broken AG.. Without auto seeding: You will need to .. Ensure endpoints in AG properly configured Suspend HADR (primary) ALTER DATAB...