Error 3241 ends with the RESTORE HEADERONLY is terminating abnormally message and it means SQL Server cannot open the header of a backup file. Five fixes follow and they are a version match, a fresh copy of the file, another backup, updates for older builds and recovery software. Test the file with RESTORE VERIFYONLY first and copy backups in binary mode. Restore a different backup when the file remains unreadable.
Error 3241 stops a restore before SQL Server touches a single table. Check the backup file and the match between the file and your server.
Microsoft explains that RESTORE HEADERONLY returns the header information of every backup set on a backup device. Unreadable headers end the restore at the first step.
Causes, checks and five fixes for RESTORE HEADERONLY is terminating abnormally follow in the order that saves the most time.
What is SQL Server Error 3241?
SQL Server raises error 3241 when it cannot process the media family of a backup device. Error 3013 follows it and names the statement that ended. Both messages appear together in the example below.
Msg 3241, Level 16, State 1, Line 1
The media family on device 'D:\SQLBackups\SchoolDB_full.bak' is incorrectly formed. SQL Server cannot process this media family.
Msg 3013, Level 16, State 1, Line 1
RESTORE HEADERONLY is terminating abnormally.
Two messages describe the failure:
| Message | Meaning |
|---|---|
| Msg 3241 | SQL Server cannot process the media family on the backup device |
| Msg 3013 | RESTORE HEADERONLY or another restore statement ended with an error and the message names the command |
Microsoft states that RESTORE HEADERONLY looks at all backup sets on the media. RESTORE LABELONLY gives a faster look at the media without every backup set.
What Causes RESTORE HEADERONLY is Terminating Abnormally in SQL Server 2016?
Six causes lead to error 3241 with a RESTORE HEADERONLY message:
- Newer Backup on an Older Server. Per Microsoft restoring a backup on a Database Engine version older than the one that created it is not possible.
- Damaged or Incomplete File. A crash, a full disk or a broken network copy produces a file that SQL Server cannot open.
- Text Mode Transfer. An FTP copy in text mode edits the bytes of a binary file so the header fails.
- Filter Driver Conflict. Microsoft documents a case on 2008 R2 where the Backup to Microsoft Azure tool found no matching blob for a copied BAK file.
- Cumulative Update Bug. Microsoft documents error 3241 on RESTORE FILELISTONLY after certain updates of SQL Server 2008 R2 and 2012.
- TDE Compressed Backups. Microsoft lists a fix for failed restores of TDE compressed backups on SQL Server 2016 and 2017.
How to Diagnose RESTORE HEADERONLY is Terminating Abnormally Before You Fix It?
Three statements show where the RESTORE HEADERONLY failure sits. Execute them on the server that raised the error and replace the path with your own.
RESTORE HEADERONLY
FROM DISK = N'D:\SQLBackups\SchoolDB_full.bak';
RESTORE VERIFYONLY
FROM DISK = N'D:\SQLBackups\SchoolDB_full.bak'
WITH CHECKSUM;
SELECT SERVERPROPERTY('ProductVersion') AS server_version;
RESTORE HEADERONLY lists the backup sets with columns like DatabaseName, BackupType, SoftwareVersionMajor, HasBackupChecksums and IsDamaged. Microsoft states that RESTORE VERIFYONLY checks that every part of the backup set is present and readable. Drop the CHECKSUM option when the backup was made without checksums because Microsoft says the option fails a backup that lacks them.
What to Verify Before You Try Any Fix?
Confirm six things before you fix the RESTORE HEADERONLY error:
- Version. Compare SoftwareVersionMajor in the header with the major number of the server version.
- Permissions. Microsoft requires CREATE DATABASE permission to obtain backup information.
- File Access. The SQL Server service account needs access to the share that stores the file according to Microsoft.
- File Source. Note whether the file arrived by FTP, a cloud sync or a plain copy.
- Split Backups. Name every file of a backup written to several devices because Microsoft requires all media families for a restore from disk.
- Free Space. RESTORE VERIFYONLY checks for sufficient space on the destination devices according to Microsoft.
Backups that fail on one server can pass on another. Execute RESTORE HEADERONLY on the source server before you call the file damaged.
5 Methods to Fix RESTORE HEADERONLY is Terminating Abnormally
Five methods fix RESTORE HEADERONLY is terminating abnormally and four of them cost nothing. Methods #1 and #2 address the common causes while method #3 gives you a new restore point.
| Feature | Version Match | Fresh Copy | Another Backup | Older Builds | Recovery Software |
|---|---|---|---|---|---|
| Cost | No charge | No charge | No charge | No charge | License needed after the demo preview |
| Fixes | Newer backup on older server | Damaged copy of a good file | Unreadable file with other backups available | Update and driver faults | Unreadable BAK file without any other backup |
| Needs | A server with the same or a newer version | Access to the source file | An earlier backup or a live database | Admin rights and a maintenance window | Copy of the damaged BAK file |
| Biggest risk | Data on an older server needs scripts | Source file is damaged too | Data after that backup is lost | Applies to old builds only | License once the demo ends |
Method #1: Match the SQL Server Version (Free, Start Here)
Microsoft states that a restore to a newer version upgrades the database when you use WITH RECOVERY. Restores to an older version are not possible.
- Check SoftwareVersionMajor in the RESTORE HEADERONLY output on the source server.
- Compare it with the ProductVersion of the destination server.
- Restore on a server that matches or exceeds the source version.
- Move the data with generated scripts or a bulk export when no newer server exists.
Note. Microsoft does not map the SoftwareVersionMajor number to product names on its RESTORE HEADERONLY page.
Method #2: Copy the Backup File Again and Verify It (Free)
Microsoft describes a case of error 3241 where a backup restored on the machine that created it and failed after a copy. Fresh copies remove transfer damage.
- Copy the file again in binary mode when you use FTP.
- Compare the hash of the source file and the copy with the PowerShell command below.
- Restore from a local disk and not from a network share or a synced folder.
- Execute RESTORE HEADERONLY and RESTORE VERIFYONLY on the new copy.
Get-FileHash -Algorithm SHA256 -Path D:\SQLBackups\SchoolDB_full.bak
Two different hashes prove that the copy was altered on the way. Matching hashes with the same error point to a damaged source file so move to method #3.
Method #3: Restore Another Backup or Create a New One (Free, Microsoft Preferred)
Microsoft advises you to repeat a restore with an alternative backup when a backup contains damaged pages. Choose a backup taken before the damage.
- List the backups with the statement below and note the file names.
- Restore the newest earlier full backup and then apply the differential and log backups.
- Create a new backup with checksums if the live database is still online.
SELECT bs.database_name, bs.type, bs.backup_finish_date,
bmf.physical_device_name
FROM msdb.dbo.backupset AS bs
JOIN msdb.dbo.backupmediafamily AS bmf
ON bs.media_set_id = bmf.media_set_id
WHERE bs.database_name = N'SchoolDB'
ORDER BY bs.backup_finish_date DESC;
BACKUP DATABASE SchoolDB
TO DISK = N'D:\SQLBackups\SchoolDB_new.bak'
WITH CHECKSUM;
RESTORE VERIFYONLY
FROM DISK = N'D:\SQLBackups\SchoolDB_new.bak'
WITH CHECKSUM;
Microsoft names the CONTINUE_AFTER_ERROR option of RESTORE as a last resort that salvages data from a damaged backup. Execute DBCC CHECKDB on the result.
Method #4: Update Older Builds and Fix the Filter Driver (Free, Older Servers)
Microsoft lists cumulative updates that fix error 3241 on RESTORE FILELISTONLY and recommends the most recent update for your version. Use the statement below as the workaround.
RESTORE FILELISTONLY
FROM DISK = N'D:\SQLBackups\SchoolDB_full.bak'
WITH CONTINUE_AFTER_ERROR;
Microsoft explains that the Backup to Microsoft Azure tool is necessary only for SQL Server 2008 R2 or below. Choose one of three fixes from its article:
- Limit the folders that the tool watches and restore from an unwatched folder.
- Stop the tool during the restore of a file copied from another machine.
- Give the copied file a different extension.
Method #5: Recover a Damaged BAK File With EmailDoctor (Preview Free, Export Licensed)
Recovery software fits a RESTORE HEADERONLY error on an unreadable BAK file when no other backup exists. EmailDoctor SQL Backup Recovery opens the file and previews the tables before any export. Scanning needs no SQL Server installation while the export to a database needs a SQL Server and admin rights.
Use a copy of the BAK file. The demo export tops out at 25 records for every table.
Add and Recover the BAK File
- Start the software on a Windows system.
- Click Browse to add the damaged BAK file and press Open.
- Use Auto detect to find the file version or choose it manually.
- Use the Multiple Backup File Options tab to add several BAK files. Add File(s) adds single files and Add Folder adds a folder.
- Select the files in the list and press OK.
- Click Recover and wait for the scan to end.
- Click any table in the left pane to see its recovered rows.
Send the Data to SQL Server
- Click Export and choose SQL Server Database under the export options.
- Fill in the server and select the Authentication mode.
- Click Create New Database and enter a name. Collation shows a default value that you can accept.
- Mark the objects to export and select With Schema & Data.
- Press Export and open the new database in SSMS to check the tables.
Deleted objects appear in red in the preview. Tick the export option for deleted records only when you need those rows.
How to Prevent RESTORE HEADERONLY is Terminating Abnormally?
Six habits prevent unreadable backups:
- Checksum Backups. Add WITH CHECKSUM to backups so damaged pages stop the backup early.
- Verify After Every Backup. Execute RESTORE VERIFYONLY because Microsoft states that it checks the header fields and the checksum.
- Binary Transfers. Copy backups in binary mode and compare hashes.
- Restore Tests. Restore the newest backup on a test server of the same version and check it with DBCC CHECKDB.
- Version Notes. Store the source version beside every backup file.
- Several Generations. Retain more than one full backup so an older restore point exists.
Troubleshooting RESTORE HEADERONLY Errors
Six problems slow down the fix:
- VERIFYONLY Passes but the Restore Fails. Microsoft states that the check does not verify the data structure so restore on a test server.
- HEADERONLY Works on the Source Server Only. The destination server uses a lower SQL Server release than the source.
- Checksum Error Stops the Restore. Microsoft says RESTORE stops on an invalid checksum by default and continues only with CONTINUE_AFTER_ERROR.
- Backup Information Is Denied. CREATE DATABASE permission is missing according to Microsoft.
- Share Is Not Reachable. The service account of SQL Server needs access to the share.
- Error Returns After a Fresh Copy. The source file is damaged so use method #3 or method #5.
Frequently Asked Questions
Does the RESTORE HEADERONLY is Terminating Abnormally Message Mean a Corrupt Database?
No. RESTORE HEADERONLY fails when SQL Server cannot open the backup header and nothing more. Microsoft describes a case where the backup restored on the machine that created it.
Can RESTORE HEADERONLY Fail Only on SQL Server 2016?
Yes. Backups made on a newer version fail on a 2016 server because Microsoft does not support restores to older versions. That file opens on a server with the same or a newer version.
Is Error 3241 the Same as Error 3013?
No. Error 3241 reports a media family that SQL Server cannot process. Error 3013 closes the failed statement and names it.
Can I Restore a SQL Server 2019 Backup on SQL Server 2016?
No. Microsoft rules out restores to a Database Engine version older than the backup source. Restore it on SQL Server 2019 or a newer version.
Is a Passed RESTORE VERIFYONLY a Guarantee of a Good Restore?
No. Microsoft notes that the statement checks readability and checksums but never examines the data structure. Test the restore on another server and then check it with DBCC CHECKDB.
Can an FTP Transfer Cause Error 3241?
Yes. Text mode edits the bytes of a binary file so copy backups in binary mode. Compare the hash of the source and the copy afterwards.
Can CONTINUE_AFTER_ERROR Force a Restore?
Yes for backups with damaged pages. Microsoft calls it a last resort and recommends an alternative backup first. Check the restored database with DBCC CHECKDB.
Do I Need SQL Server Installed to Recover the BAK File?
No for the scan. Exports to a database need a SQL Server with admin rights.
Can the Software Recover Compressed and Differential Backups?
Yes. Both backup types appear on the product feature list along with version selection from SQL Server 2000 to 2025.
Does the Free Demo Cap Exports at 25 Records?
Yes. Exports in the demo end at 25 records in a table and a paid license removes the cap. Test the export on a copy of the BAK file before you buy.
Does the Size of the BAK File Matter?
No. No file size limit exists and a test used a 1.4 TB file.
Author’s Verdict
Error 3241 and the RESTORE HEADERONLY is terminating abnormally message point to the backup file or to the version of your server. Check the version first and copy the file again before you suspect corruption.
Restore another backup whenever one exists. Update older builds and fix the filter driver when your server uses 2008 R2 or 2012.
EmailDoctor SQL Backup Recovery recovers tables and views from a damaged BAK file into a fresh database. Checksum backups and verification after every backup catch bad files early.
- RESTORE HEADERONLY is terminating abnormally when SQL Server cannot process a backup header.
- Match the server version and copy the file in binary mode first.
- Another backup or a new backup with checksums gives a clean restore point.
- Old builds need cumulative updates and a filter driver fix.
- Recovery software exports readable tables from a damaged BAK file into a new database.
Next Read: Production SQL Server Error Fixes
Also Read: Fix Error 5120 on Attach | Database Corruption Causes and Fixes