Troubleshooting Guide: SQL Server Error 4328 – Missing File During Roll Forward
Why This Error Happens
Error 4328 occurs when SQL Server attempts to restore a transaction log backup sequence but cannot locate a file (typically a differential or log backup file) that was referenced during the original backup chain. This commonly happens when a backup file has been deleted, moved, renamed, or corrupted between the time it was created and when the restore sequence attempts to use it. It can also occur if backup files are restored out of order, or if a backup set spans multiple files and one volume is missing from a multi-file backup device.
Step-by-Step Resolution Guide
Step 1: Verify the Backup File Chain Integrity
- Check the exact file path referenced in the error message (the “%ls” placeholder will show the actual missing filename).
- Navigate to your backup directory, typically
C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\Backup\, and confirm whether the file physically exists. - Run
RESTORE HEADERONLY FROM DISK = 'C:\Backups\YourFile.trn'in SQL Server Management Studio to validate file metadata and LSN ranges.
Step 2: Reconstruct the Correct Restore Sequence
- Query
msdb.dbo.backupsetandmsdb.dbo.backupmediafamilyto list all backups taken for the database in chronological order. - Confirm the LSN values align sequentially: the
first_lsnof the next log backup must match thelast_lsnof the previous one. - Identify whether a log backup between the two mentioned LSNs was skipped, overwritten, or never captured.
Step 3: Restore from an Alternate or Redundant Backup Source
- Check secondary backup locations such as network shares, Azure Blob Storage, or tape archives for a copy of the missing file.
- If using Windows Server 2025 Volume Shadow Copy Service (VSS), check
vssadmin list shadowsfor a recoverable snapshot. - Restore the missing
.trnor.difffile to the original backup folder path expected by SQL Server before re-running theRESTORE LOGcommand.
Step 4: Rebuild the Backup Chain if File Is Permanently Lost
- If the file cannot be recovered, use
RESTORE DATABASE ... WITH RECOVERYat the last successfully applied LSN to bring the database online, accepting data loss up to that point. - Immediately take a fresh full backup afterward to establish a new, uninterrupted backup chain.
- Update your backup job (SQL Agent job or Maintenance Plan) to prevent future gaps, ensuring backup retention policies don’t purge files prematurely.
Alternative or Verification Steps
- Run
RESTORE VERIFYONLY FROM DISK = 'C:\Backups\YourFile.trn'after restoring the correct file to confirm it is readable and not corrupted before applying it to the database. - If the issue persists, check Windows Event Viewer under Applications and Services Logs > MSSQLSERVER for correlating I/O or antivirus interference errors that may have caused the file deletion in the first place.