GitXplorerGitXplorer
r

SQLDatabaseBackup

public
18 stars
6 forks
0 issues

Commits

List of commits on branch master.
Unverified
0f978514f7165d0df56f13785271a72e8c3629ef

Update readme.md

rrichorama committed 11 years ago
Unverified
0c1eb0d46363bd311afec04e221e52e27e63b6cf

added notice and link to SG's blog

rrichorama committed 11 years ago
Unverified
0a6f8814bfb93c2df912d5394b3d27b6b87bceeb

recommended change in text from Geert de Graaf :¬)

rrichorama committed 11 years ago
Unverified
688290dfa171053bbc0ca54fd1bccc0ed91d9767

Merge pull request #13 from nwoolls/params-datacenter-clarification2

rrichorama committed 11 years ago
Unverified
455a710f98aa457e865abef3f058fb1a87f33d57

Merge pull request #12 from nwoolls/feature-adding-errorlogging

rrichorama committed 11 years ago
Unverified
f23d70cc57ea0388c837a11506c0d0339f2cb86b

Clarifying the usage of the -datacenter argument

nnwoolls committed 11 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