I am trying to restore a .bak file (backup taken on SQL Server 2008 R2, compatibility level 100). I am restoring the backup on SQL Server 2012 edition. I get the below error. Unfortunately the original DB from where the DB was backed up is no longer available. I am new on this project. I was given the bak file on a thumb drive.
Any suggestions on how I can restore the DB to 2012 ?
Restore of database 'TstDB' failed.
System.Data.SqlClient.SqlError: Read on ***13(The data is invalid.)
This is all is the error message. When I run RESTORE VERIFYONLY
, I get the below error:
Msg 3203, Level 16, State 1, Line 2
Read on "C:****" failed: 13(The data is invalid.)
Msg 3013, Level 16, State 1, Line 2
VERIFY DATABASE is terminating abnormally.
RESTORE HEADERONLY
was successful. When I run restore database with stats=1 I get the below:
10 percent processed.
20 percent processed.
[...]
70 percent processed.
80 percent processed.
Msg 3203, Level 16, State 1, Line 2
Read on "C:\ccc.bak" failed: 13(The data is invalid.)
Msg 3013, Level 16, State 1, Line 2
RESTORE DATABASE is terminating abnormally.
3 Answers 3
Try running a RESTORE FILELISTONLY
or RESTORE HEADERONLY
. If these run successfully, that would prove that SQL Server is successfully accessing the .bak file. (And rule out some sort of permission issue.)
If that is successful, try running your RESTORE VERIFYONLY
and RESTORE DATABASE
with STATS=1
. If it continues to fail in the same spot each time, it would probably indicate that your backup is corrupt, and you're out of luck.
If it fails in a different spot each time, it could be an issue with reliability of the location where your .bak is saved.
Community Wiki answer added to document contributions originally left as comments
From KASSQLDBA:
As per the posted error, it seems like the file may be corrupted. Please read the following to see if it helps:
Affordable Solution To Repair Corrupt SQL Backup File (TechNet Gallery Third-Party tool)
From Kin:
Can you copy the backup to another drive NOT
C:\
and then try to restore it? If it fails, its definitely corrupted and you are out of luck.
See also SQL Server Troubleshooting: How to detect and speedily fix SQL Database corruption on Microsoft TechNet.
Have you tried to detach it from the 2008 R2 server, copying the .mdf
and .ldf
files over to the 2012 server and re-attaching them to it?
It doesn't solve the backup error I know. It would get the database over to the 2012 server and if it attaches successfully would tell you that its good.
-
1From OP: Unfortunately the original DB from where the DB was backed up is no longer available.RubberChickenLeader– RubberChickenLeader2015年04月17日 16:08:27 +00:00Commented Apr 17, 2015 at 16:08
Explore related questions
See similar questions with these tags.