How to fix Error 3419 on Windows Server 2025 / Windows 11

Troubleshooting Guide: Error 3419 — Recovery Skipped Due to Required Upgrade While Database Marked for Standby

Why This Error Happens

This error occurs when a database in a log-shipping or restore sequence is set to Standby mode, but SQL Server 2025 detects that the database’s internal version requires an upgrade step during recovery. Standby mode opens the database as read-only with an undo file, which is incompatible with the schema/version upgrade process that must run during the final recovery phase. This typically happens after restoring a backup taken on an older SQL Server version (or a different build) into a newer SQL Server 2025 instance while using WITH STANDBY instead of WITH NORECOVERY.

Step-by-Step Resolution Guide

Step 1: Identify the Affected Database and Current State

  • Open SQL Server Management Studio (SSMS) or run a query against sys.databases to check the state_desc column for the affected database.
  • Confirm the database is currently in STANDBY mode by running:
  SELECT name, state_desc, is_in_standby FROM sys.databases WHERE name = 'YourDatabaseName';
  • Note the last successful backup file or transaction log file applied to this database.

Step 2: Restore the Database Using NORECOVERY Instead of STANDBY

  • Stop any active log-shipping jobs or restore scripts targeting this database to avoid conflicts.
  • Run the following T-SQL command to force the database into a restoring state:
  RESTORE DATABASE [YourDatabaseName] WITH NORECOVERY;
  • If you are mid-sequence in a restore chain, re-apply the last transaction log backup using:
  RESTORE LOG [YourDatabaseName] FROM DISK = 'C:\Backups\YourLastLog.trn' WITH NORECOVERY;

Step 3: Complete the Recovery and Allow the Upgrade to Process

  • Once the database is in NORECOVERY state, issue the final recovery command to trigger the upgrade:
  RESTORE DATABASE [YourDatabaseName] WITH RECOVERY;
  • Monitor the SQL Server Error Log (located at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG on Windows Server 2025 default installs) for upgrade script progress messages.
  • Allow sufficient time for internal system table upgrades to complete; do not interrupt the SQL Server service during this phase.

Step 4: Reconfigure Log Shipping for Standby Mode (If Required)

  • If Standby mode was required for reporting/read-access purposes, reconfigure the log shipping restore job in SQL Server Agent to use WITH STANDBY only after the initial upgrade-triggering restore has completed with WITH RECOVERY.
  • Update the restore job step properties via SSMS: SQL Server Agent → Jobs → LSRestore[InstanceName][DatabaseName] → Steps → Restore Transaction Log.
  • Ensure subsequent log restores use WITH STANDBY = 'C:\Backups\StandbyUndo\YourDatabaseName.tuf' going forward, since the version upgrade only needs to occur once.

Alternative or Verification Steps

  • Verify the fix by querying sys.databases again and confirming state_desc returns ONLINE (or STANDBY if reconfigured in Step 4) without further error entries in the SQL Server Error Log.
  • If the error persists, check for mismatched SQL Server build numbers between source and destination servers using SELECT @@VERSION; — a full version upgrade patch may be required on the destination instance before the restore can proceed.