Export and Import the database objects using BACPAC file

In this post i will be explaining about how to export the database objects to backpac and import from bacpac file.

  1. Connect to SQL Server , Right click on the database and Go to Tasks –> Export Data Tier Application



2. Introduction screen will be appeared as shown below, click next to continue


3. Export setting screen , please select where you want to store the bacpac file. It can be either on windows azure machine or on local machine. I have selected local in this example.


4. Please provide the location of the file to save the bacpac file.


5. Same export settings screen, click on advance tab to select the objects you would like to export. Once you have selected, click next to proceed


6. Progress screen will appear, it will show the progress of the export as shown in below figure


7. Results screen will appear after completion of export as shown in below figure.


8. You have successfully exported the database objects as bacpac file. Let us create new database by importing the bacpac file in another server. Right click on databases and select import Data-tier Application as shown in below screen



9.  Introduction screen will appear as show in below figure. Click next to continue


10. Import settings screen will appear and specify the bacpac file which was created before. If you have stored the bacpac file in windows azure blob storage then you can select second option to import the bacpac file. In this example, i have saved the bacpac file on the local machine.  Click next to continue.


11. Database settings screen will appear as below, specify the name of the database , data and log file path. In this case i have specified database name as “Hello_Test” and the paths are on the same drive. Best practice is to keep the data and log files separated. Click next to continue.


12. You would see summary screen as below after the above step. Click next to continue.


13. Progress screen will appear and will display the progress of the database import as show in the below figure. Click next to continue.


14. Results screen will show you the results of import progress. As you can see in the below screeshot, the import operation completed. Let us see the new database “Hello_Test” and the objects.


15. There you go. New database “Hello_Test” has been created.



So far you have learned how to export database objects as bacpac and import the bacpac to create a database. You may think, the same can be achieved by doing backup and restore. Yes, we can achieve using backup and restore. But,

  1. You do not have an option to chose few database objects/Schemas to import rather than complete database, unless you maintain separate file groups for different objects.
  2. Import a BACPAC file to create a new Azure SQL database.
  3. Restore SQL Azure database to MS SQL Server.



Hope you like the post!

Ramasankar Molleti

LinkedIn: LinkedIn Profile

Twitter: Twitter


About Ramasankar

My name is Ramasankar Molleti, I have been working on various database and cloud systems (SQL Server, Oracle, PostgreSQL, DynamoDB, Redshift, Amazon, Azure) over 12 years, primarily focusing on Architect , Development, Administration and Business intelligence. I hold various Certifications such as Amazon Web services Solution Architect Associate, Microsoft certifications (Microsoft Certified Information Technology Professional, Microsoft Certified Technology Specialist, and Microsoft Certified Solution Associate).
This entry was posted in Database Administration. Bookmark the permalink.

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