SqlBak Blog

The media family on device is incorrectly formed

If you encounter the error message, “the media family on device is incorrectly formed. SQL Server cannot process this media family,” you may not initially understand exactly what happened.

This post will try to give you a few suggestions as to what might have gone wrong and what to do in those situations.

Presumably, you tried to restore your backup and during this process received this strange error message. We have searched the web for the situations in which people have encountered this error and made a list of the most common causes.

The most common causes for this error

  1. 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 this link.
  2. 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. If the restore process fails there too, then the backup file was corrupted.
    • In order to determine why the backup was created corrupted, you have to answer a simple question: Was your backup transferred 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 to restore the backup.
  3. In case restoring the backup on the original server works without a problem, then it is possible that 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.
  4. “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 the instance the backup is pointing to by running a simple query:
      SELECT @@VERSION

      This query will return the version of SQL Server the backup is pointing to.

    • If you have the SQL Express version installed, its instance name will typically be SQL Express and you can connect to it using one of the three options:
      • (local)\SQL Express
      • .\SQLExpress
      • MyServerMachine\SQL Express
    • 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.
  5. The solution for this is to change the name of the instance you are trying to do the restore onto. If it’s a fresh installation, just reinstall and during the instance configuration specify a different unique name.

7 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.

    Reply
  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

    Reply
    • I am having this same issue now. Did you ever find a solution? Unfortunately, it’s difficult to get a full to remedy the issue when it happens. Resolving the issue so the log file restores is the best option for me. Thanks!

      Reply

Leave a Comment