Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Download an entire SQL Azure database as single file

Is there a facility in Azure to get a copy of the database? Or rather, detach the mdf and get it as file? On occasion I create a database in the cloud, it's up for a while, and then I want to take it down and archive it. My current rutine copies the database using SQL Azure Migration Wizard to a local Express instance, which I then detach and put in a safe place.

EDIT Interestingly my method of choice throws an exception this time around. So it's far from ideal.

like image 666
Gleno Avatar asked Jun 30 '11 21:06

Gleno


4 Answers

There is another way to do it:

"C:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin\SqlPackage.exe" /Action:Export /SourceServerName:"tcp:xxxxx.database.windows.net,1433" /SourceDatabaseName:DbName /SourceUser:user /SourcePassword:password /TargetFile:C:\backups\backup.bacpac
like image 189
Low Flying Pelican Avatar answered Nov 04 '22 16:11

Low Flying Pelican


From SQL Server Management Studio 2014, connect to the destination database server, right click its Databases node, and click Import Data-tier Application. In the import wizard, select the option to import from Windows Azure.

like image 37
Edward Brey Avatar answered Nov 04 '22 18:11

Edward Brey


Using Sql Managment Studio (I use 2012):

  • Create a new local database.
  • Right-click in the database -> Tasks -> Import Data

Then you need to select the azure database as the data source and you new local database as data destination.

At this point, you can create a sql server backup or generate a sql script file to get a local copy at that moment.

like image 6
dlopezgonzalez Avatar answered Nov 04 '22 18:11

dlopezgonzalez


I created the Enzo Backup for SQL Azure utility for that very reason. You can create a full backup and get your hands on a file that you can restore later to either another SQL Azure database, or a SQL Server database.

Note that SQL Azure will offer a form of backup, cloud-only, in the future. That's another good option. Finally Red-Gate has a product to copy a SQL Azure database to a local SQL Server database, but I am not sure that it gives you a "backup file" per say.

like image 5
Herve Roggero Avatar answered Nov 04 '22 16:11

Herve Roggero