Difference between BACPAC and DACPAC


A data-tier application (DAC) is a self-contained unit of MS SQL Server database deployment that allows packing SQL Server objects into a portable artifact called a DAC package. It is also known as a DACPAC.

BACPAC is simple to export a SQL Server database which will eventually require import to another server or even for longer-term retention.

IN SHORT:

A BACPAC includes the schema and data from the database.

DACPAC has only the schema and not the data.

Now we will see the difference between BACPAC and DACPAC

BACPAC vs DACPAC

1. DACPAC is Data-Tier Application Package.
BACPAC is Backup Package.

2. A BACPAC includes the schema and data from the database. It is mainly Imports from BACPAC to the database and Exports from the database to BACPAC.
DACPAC has only the schema and not the data.  The primary use of DACPAC  is to move the tested schema from the test environment to the production environment or bringing the production schema back to the test environment.

3. Extension for BACPAC file is .bacpac.
Extension for DACPAC file is .dacpac.

4. DACPAC file supports an open format that has multiple XML sections representing details of the DACPAC origin, the objects in the database, and other characteristics.
BACPAC file format is open that has schema contents. And the schema contents of BACPAC are identical to that of the DACPAC. The data in a BACPAC is stored in JSON format.

5. DACPAC operations include EXTRACT, DEPLOY, REGISTER, UNREGISTER, UPGRADE
BACPAC operations include EXPORT, IMPORT

6. The primary use case for a DACPAC is to deploy a tightly defined schema to development, test, and then to production environments. And also capturing production’s schema and applying it back to test and development environments.
However, the primary use case for a BACPAC is to move a database from one server to another – or to migrate a database from a local server to the cloud – and archiving an existing database in an open format.

I hope it’s now clear what are BACPAC and DACPAC.

Good luck!

Want me to do this for you? Drop me a line: itgalaxyzzz {at} gmail [dot] com