How can I know the SQL version of .bak file and how to restore the different SQL server version .bak file ?

May Zar 21 Reputation points
2023-01-06T10:14:00.16+00:00

When I restore .bak file via ssms, the exception " The media family on device <backup file path>is incorrectly formed. SQL Server cannot process this media family.
RESTORE HEADERONLY is terminating abnormally. (.Net SqlClient Data Provider) " is came out.

As I read, that kind of error might happen cause of the incompatible SQL version. So, I checked my SQL server version. My SQL server version is Microsoft SQL Server 2022.
I checked also the SQL server version of .bak file using "RESTORE HEADERONLY FROM DISK ='<backup path>'. At that time, "the media family on device <backup file path>is incorrectly formed. " is also276874-c1.png shown.
So, I wanna know how can I solve to know the SQL server version of .bak file and how to restore that .bak file?

Please help me out! Thanks

SQL Server Other
0 comments No comments
{count} votes

Accepted answer
  1. Erland Sommarskog 121.4K Reputation points MVP Volunteer Moderator
    2023-01-06T11:25:28.03+00:00

    Since you are on SQL 2022, there are two possible reasons:

    1) The backup file is damaged.
    2) It is not an SQL Server backup at all.

    Also, had you been an version of SQL Server which is earlier that the backup is from, SQL Server would still have recognised the backup as an SQL Server backup, but informed you that the version of the database format is not supported. (Very old versions of SQL Server would spew out an error like the above.)

    You could try opening the backup in a hex editor to see if you can get understand of what beast might be. There be some text strings that provide clues.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.