The media family on device is incorrectly formed

media family on device is incorrectly formed“The media family on device is incorrectly formed. SQL Server cannot process this media family.” is not an error that will help you pinpoint exactly what has gone wrong.
This post will try to give you a few suggestions as to what might have gone wrong and what to do in those situations.

So, you probably tried to restore your backup and during this process you got a strange error saying that the media family on device is incorrectly formed. We have searched the web and tried to find what are the situations in which people have encountered this error and tried to make a list of the most common cases.

 Most common causes for this error

    • The backup that was created is corrupt. A good way to avoid this happening is to use consistency verification options when creating the backup, see link. In order to determine if the backup file is corrupt or not we have a few options.
        • In case the version of SQL Server that you are trying to restore the backup on is newer than the version from which you made the backup, then you should try to restore the backup on the same server it was created on, and if the restore process fails there too, then the backup file was corrupted.
        • Now, in order to determine why the backup was created corrupted, you have to answer a simple question: Was your backup transfered to its current location via FTP?
          • If the answer is YES, then check that the transfer mode for the file was done in BINARY mode and not in TEXT mode or otherwise. If it was anything but binary, do the transfer again with BINARY mode and try do restore the backup.
    • In case restoring the backup on the original server works without a problem, then it is possible if you are trying to restore the backup on a newer version, but the new version is an Express edition, then if the backup is too large you might get this error.
    • The backup might still be pointing to the old instance where it was made from.
      • An Instance of SQL Server is just a name for the installation of SQL Server. Usually the first installation on a machine is the default instance, which has no specific name and you just connect to it as (local) or the name of the server machine.
      • You can validate that the instance the backup is pointing at by running a simple query:
      • SELECT @@VERSION
      • This query will return the version of SQL Server the backup is pointing at.
      • If you have SQL Express version installed, its instance name will typically be SQLExpress and you can connect to it using one of the three options:
        • (local)SQLExpres
        • .SQLExpress
        • MyServerMachineSQLExpress
      • SQL Server instances are┬ácompletely independent from each other and you have the freedom to install as many as you like, just be sure each installation has a unique instance name.
      • The solution for this is to change the name of the instance you are trying to do the restore onto. If its a fresh installation, just reinstall and during the Instance configuration specify a different, unique name.
[Total: 34    Average: 3.7/5]

About Radu Gheorghiu

Passionate SQL Developer on the journey of trying to become an expert in all things Data (storage, manipulation, gathering etc.) Information is power, and information can only be obtained from data. Thus, in order to harness the power of information, you must be a master of Data.

6 thoughts on “The media family on device is incorrectly formed

  1. whoah this blog is excellent i really like reading your articles. Stay up the good work! You already know, many persons are looking around for this info, you could help them greatly.

  2. Hi,

    I’ve gotten this error on several occasions for different databases, usually a log file. I can restore the full, diff and a few log files and then once is a while I receive an error that the log file is incorrectly formatted. At other times there are no errors reported and the database restores fully. There is no Version issue or OS issue as sometimes all files are fine. Any idea what could be causing this error. DBCC checks come up clean

    Thanks,
    Jim

Leave a Reply

Your email address will not be published. Required fields are marked *