Latest recommendations for Import\Export of SQl Server bacpac files

user1194439 picture user1194439 · Nov 15, 2012 · Viewed 10.5k times · Source

I'm trying to get up and running with Windows Azure but finding the database side extremely frustrating. I need to export my local database to a bacpac file from SQL 2008 and then import into Azure. I would also like to be able to export from Azure and then import to my local database for debugging.

I have found a few tutorials online for achieving this but every time I get part way through one of them I eventually hit a section that requires a step where the information or download is marked as outdated! it seems to have changed quite a bit over time and I can't find an up to date resource

Can anyone provide an updated link on how to do this?

Thanks

Answer

maguy picture maguy · Nov 27, 2012

I had the same issues, all documentation on importing/exporting .bacpac mostly reference SQL 2012. I needed to export a sql 2008 R2 express database to azure as well as to be able to export from azure to my local devlopment environment.

I found the SQL Database Migration Wizard v3.9.9 & v4.0.12 to do the trick.

Download Link: http://sqlazuremw.codeplex.com/releases/view/32334

Also download the documentation and it will go through the migration of .bacpac to and from the azure and your local server. What is great about the tool is it will perform a compatibility check on the database to ensure it is ready to deploy to azure.

There is also another command line tool I investigated sqlpackage.exe that can be downloaded as part of Microsoft SQL Server Data Tools

Download Link: http://msdn.microsoft.com/en-us/data/hh297027

Below is an example of exporting a .bacpac file:

sqlpackage.exe /a:Export /ssn:SERVERNAME\sqlexpress /sdn:SOURCEDATABASENAME /su:DATABASEUSER /sp:DATABASEPASSWORD /tf:c:\SOURCEDATABASENAME.bacpac