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

1

 

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

2.PNG

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.

3

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

4.PNG

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

5.PNG

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

7

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

8.PNG

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.png

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

10.PNG

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.PNG

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.PNG

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

13.PNG

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.PNG

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.PNG

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

 

16

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.

 

Cheers

Hope you like the post!

Ramasankar Molleti

LinkedIn: LinkedIn Profile

Twitter: Twitter

 

Published by Ramasankar

Hi. I’m Ramasankar Molleti. I’m a passionate IT professional with over 14 years of experience on providing solutions for customers who are looking on cloud computing, Database Migration, Development, and Big Data. I love learning new technologies and share my knowledge to community. I am currently working as Sr Cloud Architect with focus on Cloud Infrastructure, Big Data. I work with developers to architect, build, and manage cloud infrastructure, and services. I have deeep knowledge and experience on working with various database platforms such as MS SQL Server, PostgeSQL, Oracle, MongoDB, Redshift, Dyanamodb, Amazon Aurora. I worked as Database Engineer, Database Administrator, BI Developer and successfully transit myself into Cloud Architect with focus on Cloud infranstructure and Big Data. I live in USA and put my thoughts down on this blog. If you want to get in touch with me, contact me on my Linkedin here: https://www.linkedin.com/in/ramasankar-molleti-23b13218/ My Certifications: Amazon: AWS Certified Solutions Architect – Professional AWS Certified DevOps Engineer – Professional certificate AWS Certified Big Data – Specialty AWS Certified Security – Specialty certificate AWS Certified Advanced Networking – Specialty certificate AWS Certified Solutions Architect – Associate Microsoft: Microsoft® Certified Solutions Associate: SQL Server 2012/2014 Microsoft Certified Professional Microsoft® Certified IT Professional: Database Administrator 2008 Microsoft® Certified Technology Specialist: SQL Server 2008, Implementation and Maintenance

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 )

Facebook photo

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

Connecting to %s

%d bloggers like this: