December 06, 2010

The media family on device '%ls' is incorrectly formed – Troubleshooting SQL Server Backup Restore error

A www.sqlservercurry.com reader mailed me about an error he encountered while restoring a database from a .bak (backup) file using SSMS. The error said ‘Microsoft SQL Server, Error: 3241 - The media family on device '%ls' is incorrectly formed.SQL Server cannot process this media family’.

Here are some steps to resolve the error:

1. Before doing a backup, run the command SELECT @@version on both the source and destination servers. This is to make sure that the server where you are restoring the backup (destination server), has a higher version than the source server.

2. One of the primary reasons of this error is the backup going corrupt. You can use the RESTORE HEADERONLY statement to read the backup header information and check for errors. If the backup is corrupted, create a back up again and try.

3. If you are transferring the backup from one location to the other using FTP, transfer the file in binary mode. [original source]

Hopefully following the three steps shown above should resolve the error!


About The Author

Suprotim Agarwal, ASP.NET Architecture MVP works as an Architect Consultant and provides consultancy on how to design and develop Web applications.

Suprotim is also the founder and primary contributor to DevCurry, DotNetCurry and SQLServerCurry. He has also written an EBook 51 Recipes using jQuery with ASP.NET Controls.

Follow him on twitter @suprotimagarwal

2 comments:

Chintak said...

Hi,

Restore VerifyOnly will also help ind etecting backup curreption.

-Chintak

Suprotim Agarwal said...

Chintak: Good tip!