Restore Azure Database (.bacpac) file to SQL Server (.bak) file


Azure Sql Database is a fully managed relational database that provisions quickly, scales on the fly and includes built-in intelligence and security as well.

Below are the steps to restore the database from .bacpac (Azure DB backup) file to .bak (SQL DB backup) file

  1. The first step is to export the Azure DB. For this, you need to login to your Azure portal and go to SQL database in your resource group. Click Export as shown below.






  2. After clicking on Export, you have to select the storage location and add the credentials as shown below.
    This process will take few minutes to finish depending on your database size.


    Note: It is good to select the storage location (blob storage) in the same resource group, if you have multiple resource groups



  3. After the export is finished, you will get the exported file as a .bacpac file in your selected storage. (In my case, it is blob storage container)




  4. Right-click on the .bacpac file you just created and download it locally





  5. The next step is to create .bak file from the .bacpac file you just downloaded. For this, you need to open SQL Server Management Studio (I am using SQL Server Management Studio v17.9.1).
    Right-click on Databases and select Import Data-tier Application.





    You will see the below screen. Now, click Next.







  6. Click on Browse and select the .bacpac file you downloaded from Azure in the previous step and click Next as shown below –





  7. Here you can change the database name or can keep the same name as your .bacpac file.
    You can leave the other settings as it is and just click Next again.





  8. Now, you can verify all the settings below and click Finish or you can click Previous and go back to the previous settings if you want to change anything.





  9. Now you will see the progress and once it is finished, you will see the below Operation Complete screen. If there is any error, you can click on that and see what is wrong, else you will get all Success





  10. You can see the newly restored database under the Databases folder.





  11. The next step is to create the .bak file.
    For this, right-click on the new DB and select Tasks -> Back Up… as shown below –





  12. Now, you will see the below screen.
    Remove the destination path that is pre-selected by clicking Remove as shown below.
    And then click on Add to select the path where you want to store your .bak file.





  13. After clicking on Add, you will see the screen below.
    Select the destination path/folder and add the desired File name. I have added TestDB12072019.





  14. Click OK and you will see it executing. Once 100% completed, you will see the following screen –





    Thats’s it! You have created SQL Server .bak file from Azure database .bacpac file.

    Now you can see the .bak file in the folder path you selected.




    Please leave a comment, if you have any questions.

Some useful books for Azure and SQL Server on Amazon –
Professional Azure SQL Database Administration: Equip yourself with the skills you need to manage and maintain your SQL databases on the Microsoft cloud

Integrating Serverless Architecture: Using Azure Functions, Cosmos DB, and SignalR Service

Introducing Windows Azure for IT Professionals

Windows Azure SQL Database Step by Step (Step by Step Developer)

Learn SQL: A Practical Guide for SQL Server and Database Fundamentals

Dive in Windows Azure SQL Reporting

Disclosure: We use affiliate links to monetize our content.  We may receive a commission on products or services that you purchase through clicking on links within this blog.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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