9

Are BACPAC and BAK files conceptually the same thing? A single, self contained file in which you can use to backup/restore a database?

2 Answers 2

12

BACPAC files are not transactionally consistent and that can lead to a database where data is not consistent across tables. Here's what I mean by this: if you start the process of creating a BACPAC and while that's going some data gets updated in the source database then the BACPAC file could contain data from table A as it was at 1:00 PM and also data from table X as it was at 1:03 PM ... but if table A was also updated at 1:03 PM that change may not exist in the BACPAC file if table A's data was exported at 1:00 PM by the export process.

It's important to create BACPAC exports from data sources where there is no write activity while the export executes.

In Azure SQL Database for example the best practice is to first create a copy of the database in question and then run the export to BACPAC on the copy (not on the original source db). Creating a copy of the database is transactionally consistent whereas the export to BACPAC is not.

-1

bacpac and Bak files are both snapshots of database as it existed at that point of time..

The only difference,i could think of for the bacpac file is,it validates schema bindings and fails if they are not correct,other than that both are same.One is in azure and one is in onpremises

1
  • "both snapshots of database as it existed at that point of time" is not entirely true. BAK files are snapshots of the entire DB as it existed at a point in time. Bacpac files however, are snapshots of how the DB existed over the period of time while the backup was made. Ie: If the backup takes 10 minutes, each table is backed up to the bacpac file as it existed at the moment the backup got to that specific table somewhere during those 10 minutes, regardless of how other tables might have changed. This is opposed to a single moment in time for the entire DB as with a BAK file Oct 23, 2018 at 10:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.