This post describes how to import or restore BACPAC file using SQL Server Management Studio. It helps developer and database administrator to create database from one environment to another by using SSMS and importing database BACPAC file.
Backup package (BACPAC) contains schema and data for SQL Server database. We can export the database into BACPAC and import it in a new environment as a new database. This can be used as per our convenience to migrate data from one environment to another or one SQL Version to another. This restore option has become the best choice for Database Administrator and developer for migration or restore database for various purposes. This article describes how to import BACPAC file using SQL Server Management Studio. In this example, I have used SQL Server 2019 Developer edition and I would recommend to use the latest version of SQL. Let us go to import options. In the example, I will use the already created BACPAC file. If you don’t have file and need assistance to create BACPAC file, you can go through my previous article on How to Export BACPAC.
Steps to Import/Restore BACPAC File
Open SQL Server Management Studio, connect to SQL instances where you want to restore database and right click on Database. Then you will get an option as shown in the below picture. Click on Import Data-tier Application.
You will get the below window. Click on Next as illustrated in the below picture:
Then, you will get an option to import backpack file either from Local disk or from Windows Azure. As I am explaining the steps to import backpack file from local storage file, we will select Import from Local disk option and browse the file in this step.
However, we can connect to Azure Storage account and import file from Storage account and create new database with that file.
To import from Windows Azure, once we click connect Option, we have to Sign in with Azure account and select the Storage Account, Blob container and click on OK.
As the focus of the article is to import from local disk, let’s continue with Local file import steps.
Import the file from local Disk and click on Next.
Give the name of your Database and click on Next. You can keep the default file path for the Data and Log. However, you can change, file path for Data and Log.
In this step, detailed summary of your previous selections will be seen as depicted below. Click on Finish to proceed further.
Once you click on Finish, it starts creating database, based on your BACPAC file.
It may take few minutes to create database, tables, stored procedure, Views, etc. and import data to the tables. Wait for the process to complete.
Once it is completed, you can see what are the tables, store procedures, views so on created on the result windows as well as you will get option Close, click on Close.
Now, database is created using BACPAC file. You can check and verify your database. It is ready to use as per your requirement.
In short, this tip has described how to create database using BACPAC file. I hope that this post will help developers and database administrators to create a database from one environment to another by using SSMS and importing database BACPAC file.
- 6th April, 2021: Initial version