A common error when you try to restore a SQL Server database in any version is the following:
Msg 3241, Level 16, State 0, Line 4
The media family on device ‘c:\SQLBACKUPS\file_13062019.bak’ is incorrectly formed. SQL Server cannot process this media family. Msg 3013, Level 16, State 1, Line 4
RESTORE HEADERONLY is terminating abnormally.
In this article, we will see how to fix this problem.
The current article can be applied to any SQL Server. It is also required the following installers:
- First of all, the SQL Server installer
- Secondly, the SSMS installer
What does the error message mean?
The error message 3241 indicates that the backup is corrupt. The header is corrupt during restoration according to the error message 3013. Level 16 of the error message indicates that the error can be corrected by the user.
How to get more information about the error
To get more information, you can restore with the verifyonly option to see more information about this error.
To do it, you can use the T-SQL to verify if the backup is OK or corrupted:
RESTORE VERIFYONLY FROM DISK = 'c:\SQLBACKUPS\file_13062019.bak'; GO
Reasons for the problem
There can be multiple reasons. Sometimes the backup is corrupt due to a virus, malware, a hacker attack, a problem in the hard drive where the backup is stored. Sometimes, if the backup file is big, the problem can be that the file failed to be copied correctly.
If you have to move the file from one server to another, check the file size and compare the original backup and the backup copied to verify that it is fine.
How to solve the problem
In order to solve the problem, you can try to backup the file again. Sometimes, the file is corrupt because the backup failed.
The following T-SQL sentence backups the database into a file:
BACKUP DATABASE sales TO DISK = 'c:\SQLBACKUPS\file_13062019.bak' WITH FORMAT;
If the backup fails again, it may mean that the backup is corrupt. If you want to restore a corrupt database, you can use the Stellar Repair for MS SQL. This SQL database repair software repairs corrupt databases.
How to repair a corrupt database using SQL database repair software
If your database is corrupt, you can download this software to repair your database:
- The software will ask your MDF file. The MDF file is the main data file. A physical file that stores the database information.
- Select the MDF file of the database to repair and press the Repair button:
- You will be able to see the tables, views, stored procedure, and other database objects:
- Finally, you can save using the Save icon to different formats like Excel, CSV or SQL Server.
How to restore the corrupt backup
If you do not have the database or if you want to fix the database directly, you can use the Stellar Toolkit for MS SQL.
You can get the installer here.
This software includes the Stellar Backup Extractor for MS SQL. The software repairs a corrupt database with few steps.
- First of all, select a backup file using the software and press scan:
- Next, you need to select the BackupSet. You can check the backup type and date:
- As you can see, all the SQL Server versions are supported. Even SQL Server 7!
- If everything is fine, you will receive a success message:
- You can select the tables and preview the data.
- You can save the data in SQL Server, CSV file, HTML or Excel:
In this article, we learned how to fix the SQL Server 3241 error. This error is related to corruption in the backup. The headers usually are corrupted. In the article, we mention multiple solutions. One is to create a backup again, if the database is corrupt you can repair the database with Stellar Repair for MS SQL.
If you do not have access to the database or if you prefer to repair the backup directly, you can use the Stellar Toolkit for MS SQL to repair the backup.
Latest posts by Priyanka (see all)
- Product Review – Stellar Repair for MS SQL - February 18, 2021
- How to Restore MS SQL Database After Power Failure - December 28, 2020
- Database Filegroup(s) and Piecemeal Restores in MS SQL Server - February 27, 2020