In a previous blog, we learnt how to backup to Amazon S3 with LiteSpeed.
Let's see now how to backup directly to Azure. Remember that LiteSpeed does not use any temporary local storage for backups at all ...the backups just go directly to the cloud!
First that all let's start registering our account with LiteSpeed. Since in the previous blog we used the "Add Cloud Account" Wizard , let's use the "Backup Database" wizard instead this time. You can also do this in the "Restore Databases" and the "Create Backup Templates" wizards..to sum up...in any place that you might need to use your Azure account, you will have the option to register it. Very user friendly , it is not?
To start select the database in the "Backup Manager", R-click and select "Backup":
Click on "Cloud Accounts"... (2) and, in the new Window that appears, click on "+Add" (3)
Select "Azure Blob" as a "Cloud vendor" and enter the connections details (display name, access key, storage type (block blobs or page blobs), container, use SSL, government account, and automatic striping):
Let´s go in deep with the Striping Option:
Striping is splitting one backup file into multiple files. The advantage of striping is that it provides higher upload performance when backing up to the Cloud and overcomes some Cloud limitations (e.g. maximum object size on Azure Block Blob storage is 200GB). Striping provides a significant performance benefit and time saving when backing up large database files. For example, striping three blocks of one database file up provides three times the upload bandwidth over backing up one large database file to a single cloud container.
LiteSpeed provides an automatic striping option for backing up databases to the Microsoft Azure and Amazon S3 Clouds. The option can be set to auto which enables LiteSpeed to manage the striped size. Alternately, you can set the striping size in GB. If the database size is larger than the specified stripe size then the file is striped when backed up.
The automatic striping options For Azure are:
Microsoft Azure blob storage (Block blob): auto, 10, 25, 50, 100, and 190 GB (Maximum size of block blob supported by Microsoft Azure is 200GB)
Microsoft Azure blob storage (Page blob): auto, 10, 25, 50, 100, 250, 500 and 995 GB (Maximum size of page blob supported by Microsoft Azure is 1000GB)
Tip: Quest Software recommends using LiteSpeed defaults.
Once all the fields have been filled in, click "Test Connection" to verify that all entered information is working.
Perfect!" Let's continue with the "Backup Wizard" now.
Click "Add" to select the Backup Destination. LiteSpeed also offers you the possibility to generate a default file name which will help you to easily identify your backup later. Additionally you can also click on the "..." button to browse in your Azure container:
We have the "Options" section which is the same regardless the backup destination and then the "Compression" one:
As you can see there, the default value for compression is 7 since this is the default compression level we recommend for cloud backups.
The reason is that using a higher compression level has real savings. Reducing the number of bytes sent to the cloud makes for faster backups and restores and reduces Internet bandwidth.
Anyway remember that you can always use the BackUp Analyzer to determine the optimal compression levels.
Now we will go directly to the "Execute Script" section where we can preview the script LiteSpeed will run:
In this case the script would look like this:
database = N'2AdventureWorks2012Dev',
@backupname = N'2AdventureWorks2012Dev - Full Database Backup',
@desc = N'Full Backup of 2AdventureWorks2012Dev on %Y-%m-%d %I:%M:%S %p to Azure',
@compressionlevel = 7,
@filename = N'lll\2AdventureWorks2012Dev_201707031330.bak',
@CloudVendor = N'AzureBlob',
@CloudAccessKeyEnc = N'XXXXXXXXXXXXXXYYYYYYYYYYYYYYYYYYZZZZZZZZZZZZZZZ',
@CloudSecretKeyEnc = N'XXXXXXXXXXXXXYYYYYYYYYYYYZZZZZZZZZZZZZZZZZZZZZZZZZ',
@CloudBucketName = N'aatestcont1',
@AzureBlobType = N'Block',
@UseSSL = 1,
@init = 0,
@OLRMAP = 1 ,
@with = N'STATS = 10'
Tip: you can execute the scrip above in SQL Query Analyzer or other SQL scripting tool, such as Toad for SQL Server. That means that you can perform the backup without using the LiteSpeed UI Console if needed.
We are ready to backup now. Just click Next and here it is! Our first backup to Azure!
We can also see it in the "Backup History" tab in the "Backup Manager" section
Next time we will learn how to restore this backup from Microsoft Azure Blob Storage.
Hope this helps!