The media family on device '' is incorrectly formed. SQL Server cannot process this media family


Today in Microsoft community a user raised a question when he was trying to restore a backup on sql server 2008 R2 SP2. And he gets an error message

“The media family on device  '*.bak' is incorrectly formed. SQL Server cannot process this media family
 /*****************Quick Answer***************************/
 Error: The media family on device  is incorrectly formed. SQL Server  cannot process this media family
--> "Backup is correct and one is trying to restore on lower version or backup was done using some third party tool like lite speed ,red gate etc."

Error: The file on device is not a valid Microsoft Tape Format backup set.
      Note: SQL server doesn’t support restore from higher to lower version.
--> "backup is corrupt"  
 /***************************************************/


                          Even when he tried to use restore verifyonly he got the same error. Some how this user manages to open backup file using a hex editor and said source of backup is SQL 2008 R2 and he was confused if he found correct version or his backup is corrupt.

By the time I have read question almost 4 people have answered and everyone has posted their views but no one tested anything. So I have run a few quick tests

Test1: Try to restore data base on lower version


  1. Took a backup on SQL 2012 and try to restore on SQL 2008R2 , SQL 2008 , SQL 2005 and SQL 2000
  2. Took a backup on SQL 2008 R2 and try to restore on all available lower versions
  3. Took a backup on SQL 2008 and try to restore on all available lower versions
  4. Took a backup on SQL 2005 and try to restore on SQL 2000

To my Surprise every time I tried to restore with lower version
I got an error: “The media family on device 'C: \dbcheck.bak' is incorrectly formed. SQL Server cannot process this media family

Test2: Execute all restore options on lower version

  1. Restore headeronly from disk =  'C:\dbcheck.bak'
  2. Restore filelistonly from disk =  'C:\dbcheck.bak'
  3. Restore verifyonly from disk =  'C:\dbcheck.bak'

When I run all three above queries on the server with lower version than the server who owns backup file, again

I got the same error: “The media family on device 'C:\dbcheck.bak' is incorrectly formed. SQL Server cannot process this media family

Test3:  Corrupts the backup and try to restore the database on same and lower versions

  1. Take backup on any sql version
  2. Corrupt the backup by opening them in notepad and delete some characters (I took backup of 10 Mb size database)
  3. Try to restore on same and lower versions

I got error: “The file on device 'C:\dbcheck.bak' is not a valid Microsoft Tape Format backup set.

So we confirmed (CONCLUSION)


  1. If backup is correct and one is trying to restore on lower version or backup is done using third party toll like lite speed red gate.
Error: The media family on device 'C:\dbcheck.bak' is incorrectly formed. SQL Server cannot process this media family

  1. If backup is corrupt :
Error: The file on device 'C:\dbcheck.bak' is not a valid Microsoft Tape Format backup set.

Note: SQL server doesn’t support restore from higher to lower version.

18 comments:

  1. Replies
    1. Sir This is Knowledge sharing not your status page

      Delete
  2. Say that because I'm getting the exact same error when going from SQL 2005 to SQL 2012, when has MickeySoft made a product that works correctly from the get go? NEVERRRRRRRRR

    ReplyDelete
    Replies
    1. Hi Buddy,

      I appreciate if you just share your exact issue, instead talking your emotions. Please check your versions correctly using select @@version just before running restore and revert

      Delete
  3. Worst response to an issue...This is not the way to answer a question

    ReplyDelete
    Replies
    1. I appreciate if you can suggest better one here....

      Delete
  4. I had this issue and found your post. It hadn't occurred to me that the backup I was trying to restore from might be newer than what I was trying to restore to.

    I can understand the frustration others have; I'm new to being a DBA (not that I can legitimately claim the title) and frustration has become my middle name. I appreciate the time and effort you put into improving the SQL Server community.

    Thank you.

    ReplyDelete
  5. Thank you for your suggestion to select @@version.

    I was looking at vesion in Management Studio and assumed both were 2012. It seems the destination server was 2008R2 but Management Studio was 2012.

    I scripted up my db and transfered it to 2008R2 that way.

    Thanks again.

    ReplyDelete
    Replies
    1. Apart of version there is also a possibility that we are having backup generated by third party toll like lite speed or redgate

      Delete
    2. Hi Anonymous (and Saurabh Sinha),

      Your reply is exactly the same problem I've just had. I was trying to restore a .BAK (from a Lynda training course) onto my local instance of SQLExpress, and I was **VERY** surprised to find that my SQLExpress is running 2008 SP1. This appears to be the reason that I'm unable to find any DBSets in the .BAK file.

      I've been searching all morning for a solution to this problem; your post was the first helpful thing I've found. Thank you...

      Delete
  6. This comment has been removed by the author.

    ReplyDelete
  7. Hi there, I bumped into the same error message, saying blah blah blah... and there was a line.....the media family on the device is formed incorrectly, this occasion happened when I tried to backup a certain database, that I restored -successfully- from a DB.bak given by my friend.

    is there anyway to check it out? and what could I do to solve the issue?
    I'm running a backup on SQL express 2008. and I tried to back it up inside local machine, a laptop.

    ReplyDelete
  8. Verifying your backup using "Restore headeronly command" will help

    ReplyDelete
  9. The key thing I got from this was, "...opening them in notepad..." I didn't realize you could do that, so this was immensely helpful. I wish I had encountered your post 18 hours ago, but looking forward, I can continue with my project by copy/pasting. Thanks!

    ReplyDelete
  10. hi Saurabh,

    i have a strange issue here i have created a manual backup from SQL management Studio 2012 and i trying to restore in another system with same version of SQL management studio 2012 but its showing an error as "The media family on device is incorrectly formed. SQL Server cannot process this media family" kindly help

    ReplyDelete
    Replies
    1. Hi Nirmal

      Can you try" restore headeronly from disk = 'backup filepath\name' " on source server and share output, If there is error, you are having third party backup

      Delete
  11. Hi

    I have got this problem, but making backup file from SQL SERVER 2008 STANDAR to SQL SERVER 2012. The backup file restores well on another SQL SERVER 2008 STANDAR, but it does not restore on another server. This is very frustrating.

    ReplyDelete
    Replies
    1. hi , I am very much sure either there is issue with version or you have third party backup. Please confirm output of restore history and select @@ version of source and destination server.

      Delete