Error restoring a SQL database from BAK file
Solved SQL & Databases
BA
Barry Allen
September 10, 2019
2 replies
8,470 views
Reviewed by moderators

Trying to restore a vendor supplied .bak and every attempt fails: first a version error, then after moving to a newer instance, media family errors and a RESTORE terminating abnormally. Is the file junk or am I doing this wrong?

Accepted Answer
Verified by Mariya Beckham, Database Moderator ยท Reviewed September 2019

Each message means something different:

1
Version error: backups never restore to an OLDER SQL Server. Check the origin with RESTORE HEADERONLY FROM DISK='file.bak' and restore to that version or newer.
2
Media family error: incomplete or corrupt transfer. Compare file size and checksum with the vendor, and re-download without any FTP text mode nonsense.
3
Verify before restoring: RESTORE VERIFYONLY FROM DISK='file.bak' tells you if the backup itself is readable.
4
Vendor cannot re-supply and the file is truly damaged: SysTools SQL Backup Recovery reads broken BAK files and extracts the database contents directly.

HEADERONLY showed SQL 2019 origin and we were restoring to 2016. New instance, clean restore. Solved.