Search code examples
azureazure-sql-databaseazure-sql-managed-instance

Importing .bak file into Azure SQL Database


I have received a .bak file that contains a database backup, and I need to import it into an Azure SQL Database. I have tried using the "Restore" feature in Azure portal, but it seems that Azure SQL Database does not support direct restore from a .bak file. I have reviewed other questions as well it says it can only import .bacpac file if anyone can help me converting from .bak to .bacpac.

I have also seen suggestions to use the Export/Import feature, but I'm not sure about the exact steps involved. Can someone guide me on how to import the data from the .bak file into my Azure SQL Database?

I would appreciate any help or pointers on how to accomplish this task. Thank you in advance!

I tried to import it in Azure SQL server import data tier app but when it is opening it says only support .bacpac file


Solution

  • AFAIK you cannot import .bak file directly in Azure SQL database. Import feature of Azure SQL database support .bacpac file.

    The workaround you can try is as below:

    1. You need to restore .bak file to in your local SSMS
    • Right click Databases on left pane (Object Explorer)
    • Click Restore Database...
    • Choose Device, click ..., and add your .bak file
    • Click OK, then OK again

    enter image description here

    1. Then again export this restored database to .bcpac file. like below: enter image description here

    2. After this upload this .bacpac file to your storage account. enter image description here

    3. Then use this storage account and file to import database. using Import feature in Azure SQL database.