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

Troubleshooting Guide: Error 12625 – RESTORE VERIFY Failed on Clone Backup

Why This Error Happens

Error 12625 occurs when SQL Server 2025’s RESTORE VERIFYONLY operation detects that the backup file’s internal checksums or header structure do not match the expected values for the cloned backup set. This is typically caused by the backup file being truncated, corrupted during a copy/transfer operation, or modified by antivirus/backup software after creation. It can also occur if the clone operation (such as a storage-level snapshot or file-copy clone) completed before SQL Server released its file lock, resulting in an incomplete or inconsistent backup image.

Step-by-Step Resolution Guide

Step 1: Validate the Integrity of the Source Backup File

  • Run RESTORE VERIFYONLY FROM DISK = 'C:\SQLBackups\YourBackup.bak' against the original (non-cloned) backup file to confirm it is valid.
  • Check file size consistency between the source and cloned copy using Get-Item in PowerShell:
  • Get-Item "C:\SQLBackups\YourBackup.bak" | Select-Object Length
  • If the source file itself fails verification, the issue originates at backup time, not during cloning.

Step 2: Re-Clone the Backup File Using a Clean Copy Method

  • Ensure no process (antivirus, backup agent, or snapshot tool) is locking the file during the clone operation.
  • Use robocopy with checksum validation instead of a basic file copy:
  • robocopy C:\SQLBackups\ D:\ClonedBackups\ YourBackup.bak /J /V /NP
  • Confirm the destination volume (D:\ClonedBackups) has sufficient free space and is not using compression/deduplication that could alter file blocks.

Step 3: Exclude SQL Server Backup Paths from Antivirus/EDR Scanning

  • On Windows Server 2025, open Windows Security > Virus & threat protection > Manage settings > Exclusions.
  • Add exclusions for:
  • C:\SQLBackups\
  • D:\ClonedBackups\
  • The SQL Server Data/Log directories (default: C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Backup\)
  • Restart the SQL Server service and re-run the clone operation.

Step 4: Re-run RESTORE VERIFYONLY with CHECKSUM Validation

  • Execute the following T-SQL command against the cloned file:
  • RESTORE VERIFYONLY FROM DISK = 'D:\ClonedBackups\YourBackup.bak' WITH CHECKSUM;
  • If Error 12625 persists, regenerate the backup using WITH CHECKSUM enabled at backup time:
  • BACKUP DATABASE [YourDB] TO DISK = 'C:\SQLBackups\YourBackup.bak' WITH CHECKSUM, COMPRESSION;

Step 5: Check Storage-Level Snapshot or VSS Clone Timing

  • If using Volume Shadow Copy Service (VSS) or SAN-based snapshot cloning, verify the SQL Server VSS Writer completed successfully before the snapshot was taken.
  • Run vssadmin list writers in an elevated PowerShell session and confirm “SqlServerWriter” shows a state of [1] Stable with no errors.
  • If the writer shows a failed state, restart the SQL Server VSS Writer service and re-trigger the clone job.

Alternative or Verification Steps

  • Verify the fix by successfully running RESTORE VERIFYONLY FROM DISK = 'D:\ClonedBackups\YourBackup.bak' WITH CHECKSUM; and confirming the output returns “The backup set on file 1 is valid” with no errors.
  • As an alternative, skip file-level cloning entirely and use BACKUP DATABASE ... TO URL (Azure Blob Storage) or a native SQL Server backup replication tool to generate the clone directly from the source database, bypassing file-copy corruption risks altogether.