Our production database server is backing up its databases nightly to Azure Blob Storage, using the BACKUP TO URL command in SQL Server 2014 Standard. I'm now attempting to restore those backups to a new SQL Server VM we set up in Azure, which is also running SQL Server 2014 Standard. I'm running the following SQL command:

RESTORE DATABASE Example FROM URL = 'https://exampleaccount.blob.core.windows.net/livedbbackups/ExampleBackup-2015-10-15T01-13-08.bak';
WITH CREDENTIAL = 'AzureBackupCredential', 
MOVE 'Example' TO 'C:\Databases\Example.mdf',
MOVE 'Example_log' TO 'C:\Databases\Example.ldf',
STATS = 5;

When I do this, the restore runs for 10+ minutes, and I can see it making progress in the "Messages" window of SQL Server Management Studio. However, right before it gets to 100% done, the following error message is displayed.

Output on Azure VM running Microsoft SQL Server 2014 - 12.0.4213.0 (X64) Standard Edition (64-bit) on Windows NT 6.3 (Build 9600: ) (Hypervisor):

85 percent processed.
90 percent processed.
95 percent processed.
Msg 3013, Level 16, State 1, Line 5
RESTORE DATABASE is terminating abnormally.

Googling for "SQL Server Error 3013" or "SQL Server restore database terminating abnormally" produces a lot of pages suggesting my database file is corrupt. However, I don't think it is, because I can run the exact same SQL on my laptop running SQL Server 2014 Express, and I get the following output:

Output on Laptop running Microsoft SQL Server 2014 - 12.0.2269.0 (X64) Express Edition (64-bit) on Windows NT 6.3 (Build 10240: ) (Hypervisor):

85 percent processed.
90 percent processed.
95 percent processed.
100 percent processed.
Processed 233600 pages for database 'Example', file 'Example' on file 1.
Processed 5 pages for database 'Example', file 'Example_log' on file 1.
RESTORE DATABASE successfully processed 233605 pages in 205.802 seconds (8.867 MB/sec).

Both of these restore statements were run against the exact same URL, with the same unaltered backup file. If it restores correctly on my local copy of SQL Server Express, it can't be corrupt, right?

Here are some other possible causes I tried to rule out:

  • Version mismatch - The backup was run on a server running Microsoft SQL Server 2014 - 12.0.2269.0 (X64) Standard Edition (64-bit). The restore was run on a server running Microsoft SQL Server 2014 - 12.0.4213.0 (X64) Standard Edition (64-bit). These version numbers were determined by running SELECT @@VERSION on each of the servers.
  • Perimssions errors - Both RESTORE HEADERONLY and RESTORE FILELISTONLY work correctly on the Azure VM that won't restore the database.
  • Free space - The C: drive on the Azure VM has more than 80 GB free.
  • Network connectivity - I haven't done any extensive testing, but given that the VM running SQL Server is running inside Azure, and the backup file is also in Azure, I imagine it's pretty stable. File downloads and simple tests with the browser seem to indicate that the connection is both stable and fast.

The database in question is about 2 GB when restored, with a 5 GB log file. I have other backups of the same database stored in Azure, and I get the same results when trying to restore any of them (works on local SQL Server Express 2014, fails on Azure VM SQL Server Standard 2014).

Any ideas what might be causing this and how to fix it?

  • 1
    Try adding a new disk to the VM and restore the backup to that disk. Spin up a new VM or try on another Azure VM. If you get the same error on both of those test, submit a ticket to Microsoft through the portal. – user47078 Oct 19 '15 at 8:26
  • @Shawn - Good suggestion. I added a disk to the VM (didn't realize I could do that!) and moved the restore location to the new disk. Now the restores usually succeeds, but I still get the "restore database terminated abnormally" message occasionally. – Joshua Carmody Oct 20 '15 at 18:02
  • Running into the same problem. No idea why. Just started - I've successfully tested restores in the past. – Ken Smith Dec 14 '15 at 22:24

this thread is a bit old but I was facing the same issue today. I did a restore from blob storage some time ago and everything worked fine, a week later the same restore was returning an error “RESTORE DATABASE TERMINATED ABNORMALLY”. So I moved my backup files to a different container and it worked just fine.

Hope this workaround helps someone else.

| improve this answer | |

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.