Let's backup in Google storage with LiteSpeed for SQL Server 8.7!

We know that from LiteSpeed for SQL Server 8.5 we can backup to Azure and  Amazon S3.
Now that LiteSpeed for SQL Server 8.7 is out, we can also backup to Google storage.
Google Cloud Storage is unified object storage for developers and enterprises, from live data serving to data analytics/ML to data archiving. LiteSpeed supports Multi-Regional, Regional, Nearline and Coldline storage types.

Let's see how to do this. In this case we are going to start the Backup Wizard by r-clicking the instance we want to backup:

Dave: Come on! Another post using the Wizard? I'm not a fan of wizards, I prefer using T-SQL or the command line!!!!
Me: Ok! Don't worry! LiteSpeed also offers these options and with a little bit of patience, I will show you these scripts as well.

Let's continue then.
Here I will select full backup and then all the settings by default:

In the Backup Destination section, let's select Cloud and then let's click on Clouds Accounts

Then click Add and select Google Storage as Cloud Vendor.
Here you can enter the data manually or Load the JSON key to obtain the account information. Note that this JSON key needs to be provided by your IT Department. For more information about this file please have a look at Google Cloud documentation.

Here I will load the JSON key and all the fields will be populated:

.

Is always good to click on Test Connection to make sure all went fine: 

Now that we have the account created let's select it and continue from there:

I will ignore the next sections as they are not needed for the purpose of this blog:

   

At the bottom of the Execute Script section we see the following hyperlinks:

Do you want to add a comment?  Click Add Comment:

Do you prefer to conduct the LiteSpeed backup directly from your operating system command-line? Then click Preview CMD Line Script and see the output:

sqllitespeed.exe -Bdatabase -D"AdventureWorks2012" -C7 -n"AdventureWorks2012 - Full Database Backup" -d"Full Backup of AdventureWorks2012 on %Y-%m-%d %I:%M:%S %p"
-Y"first backup to Google Storage! So Excited! :0)"
--OLRMap -F"AdventureWorks2012_201806110959.bak" --CloudVendor "GoogleStorage"
--CloudAccessKey "lsstorageaccount@lsnewprXXXXXXXXXXXXXXXXt.com"
--CloudSecretKeyEnc "mySuperLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongSecretGoogleStorageKey" 
--GSProject "lsnewproject" --CloudStorageClass "nearline" --CloudRegionName "us" --CloudBucketName "autotests" --UseSSL -S"W2012R2SOSSE" -T

Do you need to run the backup from SSMS? Then click on Preview Script:

exec master.dbo.xp_backup_database
@database = N'AdventureWorks2012',
@backupname = N'AdventureWorks2012 - Full Database Backup',
@desc = N'Full Backup of AdventureWorks2012 on %Y-%m-%d %I:%M:%S %p',
@compressionlevel = 7,
@filename = N'AdventureWorks2012_201806110959.bak',
@CloudVendor = N'GoogleStorage',
@CloudAccessKey = N'lsstorageaccount@lsnewprXXXXXXXXXXXXXXXXt.com',
@CloudSecretKeyEnc = N'mySuperLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongSecretGoogleStorageKey',
@GSProject = N'lsnewproject',
@CloudStorageClass = N'nearline',
@CloudRegionName = N'us',
@CloudBucketName = N'autotests',
@UseSSL = 1,
@init = 0,
@comment = 'first backup to Google Storage! So Excited! :0)',
@OLRMAP = 1 ,
@with = N'STATS = 10'
GO

In our case we will just click Next to continue with the backup. Hurray! our first backup in Google Storage is ready!

Hope this helps and thanks for reading!

Anonymous