Offer Offer

News We Recently Launched AD Migrator and AD Reporter.

How to Import/Export BACPAC File to SQL Server in Windows & Linux?

  author
Written By Kumar Raj
Anuraag Singh
Approved By Anuraag Singh
Published On June 13th, 2024
Reading Time 5 Minutes Reading

BACPAC import/export

Thinking about the BACPAC file import/export in SQL server database. This topic is trending among users nowadays for several reasons. Users want to learn how to import/export BACPAC file to SQL Server for various reasons like database migration, building a testing & development environment, and backing up data in simplified formats. The BACPAC file is the best option for them as it combines both schema & data of the SQL database objects.

This article consists of the complete BACPAC import/export process for both Windows & Linux Ubuntu/CentOS operating systems. Moreover, here, users will get to understand about the BACPAC file, DACPAC file, benefits of creating a BACPAC file, etc.

We’re sure that users can be equipped with the knowledge to leverage BACPACs for efficient SQL Server database management.

All Data Transfer Methods – Why Use BACPAC Method?

Well, for data transfer in SQL Server database, users often consider, regular import/export, generate scripts, etc methods. However, there are some restrictions that come along with those methods. However, let’s discuss what are all the available methods that users have.

  • Generate Data Script
  • Data Import and ExpWizard
  • The BACPAC Package Method

It is not possible for users to restore individual tables using SQL database backups. Moreover, for larger databases, such methods are neither efficient, not practical. Secondly, we have firewall issues being a firm barrier. This is because DBAs keep their main database & the testing database separate. Therefore, they don’t allow the firewalls between these two.

Therefore, using the BACPAC Package method for export & import tasks in SQL Server is the safest option for SQL Server database owners.

We can run this method in both Windows & Linux (Ubuntu, CentOS, etc). Let’s understand what actually is a BACPAC & how it’s different from DACPAC.

What is the DACPAC & BACPAC Package? Major Differences in Both

BACPAC stands for Backup Package which consists the schema as well as the data of SQL Server tables & their objects. DBAs can create a BACPAC file of their database & then share it with the testing & development team for further work without hampering the actual server.

However, DACPAC stands for Data-Tier Application Package which defines tables, views, users, logins, etc data objects as a logical database entity. The only catch here is that it does not contain data but only schema. Thus it is also known as a single package file. Moreover, several SQL users compare schemas of different copies of SQL databases using the DACPAC or single package package.

Now, that we understand what BACPAC & DACPAC are, it’s time that we proceed further toward the export & import task.

BACPAC Export SQL Server Using SSMS

Now, for Windows, users need to first Open the SSMS or SQL Server Management Studio. Here, after connecting to the SQL instance, they need to expand the Databases option. Now, right-click on the preferred database & hit the expand option. Now, Go to tasks, & then select the desired data-tier application options.

Here a few options are:

  • Extract Data-tier application: This option is to create a DACPAC file containing only the schema data in it for testing purposes.
  • Export Data-tier application: With this option, users create the BACPAC file & export it to the local system at any desired folder path.

BACPAC import/export

 

How to export BACPAC file from SQL Server on Windows Step by Step?

1. When users Click on the Export Data-tier Application option, the system launches an introduction page as follows. Now, Click on Next here.

export data tier application for BACPAC import/export2. Now, users can witness the page of export settings.

export settings3. Here, users get the feature to configure a Microsoft Azure storage container.or a local disk directory.

path

4. Go to the Advanced tab & then review the database objects easily in the list.

advance

5. Click on the Next button to now review the configurations.

click next

  1. Finally, Hit the Finish button to complete the export BACPAC file from SQL Server task.

operation complete

  1. Now, users can go to the directory to cross-check if the file is present there or not.

cross check BACPAC import/export

SSMS to Learn How to Import BACPAC File

This time, instead of the Export, we are going to use the Import Data-tier Applications option. Here, users just need to specify the source path where the file is stored, then adjust the configuration settings, & at last can compare the expected & actual results.

The steps for the same are:

1. Launch the Import Data-tier Applications wizard.

input wizard

2. Now, Specify the Source Path of the BACPAC file for import

path

3. Enter the input of the data & log for the new database.

enter database input

4. Users need to create a new database for importing a BACPAC file. Otherwise, it’ll show this error:

error

5. Change the database name & other settings as well as required.

change name

6. Now check if all the details shown here are correct prior to clicking finish.

click finish for BACPAC import/export

7. Finally, the system shows the import process is successful.

BACPAC import complete

Also Read: Restore MDF File from Backup with Ease

Wrapping Up

Finally, users can easily execute BACPAC Import/Export in SQL database for Server in both Linux & Windows OS. Moreover, we have mentioned all the required details that users need to keep in mind. By now, users must have learned how to import or export BACPAC file to SQL Server database. Still, users can contact us in case of any further doubts.

  author

By Kumar Raj

A versatile writer with the vast knowledge of technology helps to reduce the gap between a user and technology. Provides easy and reliable ways to resolve multiple technical issues, which users encounter in their day-to-day life.