unpack bacpac files and ease migrations

There were days when i spend hours watching my bacpac files slowly getting restored and then suddenly crashing :/ I have seen this issue often where a table with large amount of data would crash in between restore and i had no other option as i didn’t knew what to do with bacpac files.

But after some reading I found that the bacpac file was just a renamed .zip file and could be extracted and perhaps even edited. This gave me a way out. I extracted the bacpac file to see what I could find.

Here, nicely laid out is the package that is a bacpac file. Opening the Data\ folder will show you the data that is targeted for each table nicely arranged by table name.


This made up set of tables shows the layout. Simply choose the tables that have expendable data, such as log entries, error logs, traces etc. Open those files and delete the .BCP files that are contained in them.

Now just re-compress those files, rename the resulting .zip files to .bacpac and you are good to go. One note: when you re-zip those files, make sure to do so from the root of the bacpac folder that was extracted, not the parent folder you extracted to. If you compress the whole folder, the nesting of the files will be off and you will get an error on import.


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