GitXplorerGitXplorer
r

SQLDatabaseBackup

public
18 stars
6 forks
0 issues

Commits

List of commits on branch master.
Unverified
7569223c8d099b92e55e50973e7c7cc793c70e06

Log exceptions to the Windows Event Viewer

nnwoolls committed 11 years ago
Unverified
ea8e860c6e742fc9ab0e68cc748ce2493e81303f

Merge branch 'master' of https://github.com/richorama/SQLDatabaseBackup

rrichorama committed 12 years ago
Unverified
0b8229b9a80b39103c9978b088302e6ef5f76e3f

fixed unaccuracy in readme

rrichorama committed 12 years ago
Unverified
7b0086b4e9b5803db7d9af6c2b06e0a11d533853

updated title

rrichorama committed 12 years ago
Unverified
3b7b9df04c94032ed9139ecf9020bfef6058a807

reference to AzureStorageCleanup

rrichorama committed 12 years ago
Unverified
96f12a61dd9d90f89b3699bd84fb56249d76415e

typo in readme

rrichorama committed 12 years ago

README

The README file for this repository.

Windows Azure SQL Database Backup Utility

Daily automated SQL backups are now available in the Azure Portal. See Scott Gu's Blog for more detail.

This utility will take a copy of your SQL Database, and once the copy has completed, will make a backup of the database to blob storage using the bacpac format.

Please supply for following command line arguments:

    -server [SQL Database server (without .database.windows.net)]
    -database [database to back up]
    -databasecopy (optional) [The name of the temporary copy database, defaults to database_copy]
    -user [SQL Database username]
    -pwd [SQL Database password]
    -storagename [Blob Storage account name]
    -storagekey [Blob Storage account key]
    -container (optional) [Blob storage container to use, defaults to sqlbackup]
    -datacenter [The data centre that both the database and storage account are located]
        (westeurope | southeastasia | eastasia | northcentralus | northeurope | southcentralus | eastus | westus)
	-cleanup 

Example usage:

SQLDatabaseBackup.exe 
    -server nevixxs 
    -database mydb 
    -user username 
    -pwd password 
    -storagename storageaccount 
    -storagekey dmASdd1mg/qPeOgGmCkO333L26cNcnUA1uMcSSOFM... 
    -datacenter eastasia
	-cleanup

How it works

To create a transactionally consistent backup the utility creates a copy of your database, and then uses the Azure Backup API to copy that database to a bacpac file in Blob Storage.

The backup process is not transactionally consistent, so the utility creates a copy of your database, and then uses the Azure backup API to copy that database to a bacpac file in Blob Storage.

The database copy will be deleted when the utilty starts, if it already exists.

Please ensure that a 'sqlbackup' container exists in your storage account (or specify a different value using -container), otherwise the backup API will throw an error.

The bacpac file will have the date and time of the backup appended to the name, allowing you to keep a history of backups.

Blob cleanup

To delete old backups from blob storage, see this related project: https://github.com/nwoolls/AzureStorageCleanup

Credits

Thanks to @nwoolls for his contributions.

License

MIT