Philip
Philip

Reputation: 2628

How to get BAK files from SQL 2008 R2 to Azure

I know from SQL 2012 you can backup directly to Azure, but I have a SQL 2008 R2 instance where I'm needing to get the backups up to Azure for off-site backup reasons.

Anyone have some good options for what could be considered here?

Upvotes: 0

Views: 441

Answers (1)

Andrey Nikolov
Andrey Nikolov

Reputation: 13450

You can write a PowerShell script, which will backup your database using Backup-SqlDatabase cmdlet, and then copy the BAK file to Azure Blob Storage using Set-AzureStorageBlobContent cmdlet. Of course, you can also use your existing backup solution, but it may be more difficult to plug the call to Set-AzureStorageBlobContent in it. If you use SQL Server Agent, you can add a step with PowerShell or call to external executable to upload the recently made backup.

# Upload file from local disk to Azure Blob Storage
Set-AzureStorageBlobContent -Container "SQLServerBackups" -File "E:\Backups\MyDatabase-2018-01-01.bak" -Blob "MyDatabase-2018-01-01"

Upvotes: 1

Related Questions