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
--> "B
ackup 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
Took a backup on SQL 2012 and try to restore on SQL 2008R2 , SQL 2008 , SQL 2005 and SQL 2000
Took a backup on SQL 2008 R2 and try to restore on all available lower versions
Took a backup on SQL 2008 and try to restore on all available lower versions
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
- Restore headeronly from disk =
'C:\dbcheck.bak'
- Restore filelistonly
from disk =
'C:\dbcheck.bak'
- 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
- Take backup on any
sql version
- Corrupt the backup
by opening them in notepad and delete some characters (I took backup of 10
Mb size database)
- 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)
- 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.
The media family
on
device
'C:\dbcheck.bak'
is
incorrectly formed
.
SQL Server cannot process this
media family
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.
MickeySoft SUCKS
ReplyDeleteSir This is Knowledge sharing not your status page
DeleteSay 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
ReplyDeleteHi Buddy,
DeleteI 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
Worst response to an issue...This is not the way to answer a question
ReplyDeleteI appreciate if you can suggest better one here....
DeleteI 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.
ReplyDeleteI 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.
Thank you for your suggestion to select @@version.
ReplyDeleteI 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.
Apart of version there is also a possibility that we are having backup generated by third party toll like lite speed or redgate
DeleteHi Anonymous (and Saurabh Sinha),
DeleteYour 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...
This comment has been removed by the author.
ReplyDeleteHi 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.
ReplyDeleteis 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.
Verifying your backup using "Restore headeronly command" will help
ReplyDeleteThe 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!
ReplyDeletehi Saurabh,
ReplyDeletei 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
Hi Nirmal
DeleteCan 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
Hi
ReplyDeleteI 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.
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