I have received a .bak file from MSSql database from a friend of mine. He is quite desperate because his system failed, and he was able to recover the last database backup. This should be enough to get things going, but he cannot recover the file using latest MSSql 2016. When restoring, he gets an error message [sorry, the message is in polish language, so I'm doing my best with translation]:

Database cannot be restored on Your SQL Server 12.0.4100.1.
(Version of SQL Server which created the backp: -1.-1 file format: -1, preferred file format: 782).

At the moment, where I am it is after midnight, and the only computer I have is my macbook with storage shortage, so I can't just install Windows and SQL Server on it to have a go at trial and error with the database restore.

I am wondering, if there's something obvious I am try on a windows machine with SQL Server?

My best bet is to try and get the version of SQL Server which created the archive, hoping it will be able to restore it. Howver how can I learn about the version? -1 is not helping me much...

Is there something else I could do to restore the database or to learn the version this backup originates from?

  • Does your friend not know what version SQL Server he was running and which created the database backup? – joeqwerty May 26 '17 at 1:44
  • No, the database was bundled as part of the application he uses. Unfortunately, the support of that app was unhelpful. After looking at the error message they just said that the backup is corrupted and there's nothing they can do. That's the backup their application created as part of daily backups.... Unfortunately, this is the only daily we have. – Krystian May 26 '17 at 5:16

It seems that the bak file contains a header that can be read using RESTORE HEADERONLY FROM DISK = 'C:\path\to\mydatabase.bak'

sauce: http://www.imiscommunity.com/restore_headeronly_how_to_check_the_version_of_a_sql_server_bak_file

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.