Experience Management

Restore a Sitecore Database from an Azure SQL Database BACPAC File

If you are working with Sitecore in Azure and your databases are Azure SQL Databases, you may find yourself in need of restoring a backup from Azure to your local environment. When you create a database backup from Azure (or your project architect provides it for you), you will notice that the file extension is “.bacpac” and not the familiar .bak of a SQL database. When you first attempt to restore the database, you will notice that you cannot select the .bacpac file. To complete the restore, you will need to follow these FREE Microsoft instructions┬áto “Import Data-tier Application”. Unfortunately, you cannot simply overwrite your existing master database with the new .bacpac like you can with a .bak file, so you have to go through the steps of renaming databases. I put together a short SQL script to help speed that process along:

Run This Script

The Digital Essentials, Part 3
The Digital Essentials, Part 3

Developing a robust digital strategy is both a challenge and an opportunity. Part 3 of the Digital Essentials series explores five of the essential technology-driven experiences customers expect, which you may be missing or not fully utilizing.

Get the Guide

Make sure to update the variables to match your actual database names!

Last Steps

Manually delete the “_old” database after the script runs. You can add that as a step to the script yourself if you aren’t paranoid like me! I would recommend a full “Republish – publish everything” of your site afterwards.

About the Author

More from this Author

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Subscribe to the Weekly Blog Digest:

Sign Up