I am trying to restore a .BAK in SQL server but get the following error:

Msg 3241, Level 16, State 7, Line 1 The media family on device 'c:\glyn\JA.bak' is incorrectly formed. SQL Server cannot process this media family. Msg 3013, Level 16, State 1, Line 1 RESTORE DATABASE is terminating abnormally.

I have tried restoring using 2012, 2008 and even 2005 but nothing works, I have used the following query and through the Tasks >> Back up but nothing works, here's my SQL:


Does anyone have any suggestions? I've read that the bak could be corrupt, it was sent to my by another developer on DVD who is working on the project.


7 Answers 7


If you are attempting to restore newer database to older SQL version you can always simply manually create the database in the older SQL version and utilize the task - generate scripts and include the data.

Save to File --> Advanced--> Types of data to script --> Schema and data.

Also make sure to Script for Server Version.

This might be the only supported option if you're trying to go from newer SQL Server to older version.

Related: Restore SQL Server 2012 backup to a SQL Server 2008 database?

  • Seems like a hack but I guess this worked around this issue in my case.
    – jpierson
    Oct 31, 2016 at 19:12

I had the same problem, my script was specifying the incorrect FILE type, I had a .bak and I was specifying FILE = 2 which is a .trn.

USE [master]
DISK = N'D:\MyOldDB.bak'
    FILE = 1, -- 1 = .bak, 2 = .trn type backup
    MOVE N'MyOldDB' TO N'd:\data\MyOldDB.mdf',
    MOVE N'MyOldDB_log' TO N'd:\data\MyOldDB_log.ldf',
    STATS = 5    

I'm not sure if the RESTORE command auto-detects or sets a default for this...

  • 1
    The error turns around this, the problem is when you use the GUI to restore databases, SQL Managment Studio does not provide you detailed information. If you try to restore using t-sql script, sql server will report you to use MOVE option. Dec 1, 2015 at 9:37

I found this that says that your backup file is corrupted. Possibly transfered by FTP in text mode rather than binary.

And this blog that lists how someone else fixed the same problem.

  • 9
    "lists how someone else fixed the same problem" generally on SE network sites you should post the relevant bits of things like blog posts; it prevents link decay
    – jcollum
    Dec 31, 2014 at 20:57

Run the following script on source and destination SQL Servers, the versions should either match or the destination should have a higher version of SQL Server otherwise you cannot restore the .bak file:

SELECT @@Version
  • 1
    The point about versions has been repeated in other answers.
    – Andriy M
    May 21, 2016 at 23:01
  • 1
    @AndriyM you are right, but a practical action was missing. We are not talking about history or geography, some command or code should be mentioned. May 22, 2016 at 10:45

The only reason is you are trying to restore lower version backup, Refer: http://www.sqlservercentral.com/Forums/Topic1675066-1550-1.aspx?Update=1


If you are restoring from S3 into RDS make sure you mention the key you encrypted the file with when the backup was taken. I.e.:

exec msdb.dbo.rds_restore_database
    @kms_master_key_arn='arn:aws:kms:eu-west-2:<kms key id>';

delete corrupted file and re-run the backup

  • 4
    Hi, Welcome to the site. We like a bit more detail on how why or how this would work.
    – Tom V
    Oct 27, 2016 at 20:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.