SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SQL Backups in AWS not on RDS


SQL Backups in AWS not on RDS

Author
Message
rwyoung01
rwyoung01
SSC Veteran
SSC Veteran (250 reputation)SSC Veteran (250 reputation)SSC Veteran (250 reputation)SSC Veteran (250 reputation)SSC Veteran (250 reputation)SSC Veteran (250 reputation)SSC Veteran (250 reputation)SSC Veteran (250 reputation)

Group: General Forum Members
Points: 250 Visits: 308
I am doing native SQL backups on a windows 2012 server to an S3 bucket. The full's (40gb) never make it from the cache drive to the S3 bucket. What am i doing wrong
Steve Jones
Steve Jones
SSC Guru
SSC Guru (603K reputation)SSC Guru (603K reputation)SSC Guru (603K reputation)SSC Guru (603K reputation)SSC Guru (603K reputation)SSC Guru (603K reputation)SSC Guru (603K reputation)SSC Guru (603K reputation)

Group: Administrators
Points: 603897 Visits: 21115
I think you'll need to provide more info. I assume you have a virtual machine in AWS that's running SQL Server. The version shouldn't matter, but are you backing up to a URL from SQL Server or have the s3 bucket mapped or something else?

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
rwyoung01
rwyoung01
SSC Veteran
SSC Veteran (250 reputation)SSC Veteran (250 reputation)SSC Veteran (250 reputation)SSC Veteran (250 reputation)SSC Veteran (250 reputation)SSC Veteran (250 reputation)SSC Veteran (250 reputation)SSC Veteran (250 reputation)

Group: General Forum Members
Points: 250 Visits: 308
I have mapped the S3 url as a drive.
RTaylor2208
RTaylor2208
SSChampion
SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)

Group: General Forum Members
Points: 11586 Visits: 1544
I believe you have to backup to local storage on the EC2 instance and then upload the file to S3 using this method, if the file is going to be larger than 5GB in size.

https://aws.amazon.com/blogs/aws/amazon-s3-multipart-upload/

MCITP SQL 2005, MCSA SQL 2012
Mário Pereira
Mário Pereira
SSC-Enthusiastic
SSC-Enthusiastic (128 reputation)SSC-Enthusiastic (128 reputation)SSC-Enthusiastic (128 reputation)SSC-Enthusiastic (128 reputation)SSC-Enthusiastic (128 reputation)SSC-Enthusiastic (128 reputation)SSC-Enthusiastic (128 reputation)SSC-Enthusiastic (128 reputation)

Group: General Forum Members
Points: 128 Visits: 0
Hello rwyoung01

You can now export .bak file from a EC2 instance running SQL Server to S3.

http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/SQLServer.Procedural.Importing.html

But if you want to code everything by you check my GitHub https://github.com/mariopoeta/backupsqlservertos3
lsalih
lsalih
SSCertifiable
SSCertifiable (5.5K reputation)SSCertifiable (5.5K reputation)SSCertifiable (5.5K reputation)SSCertifiable (5.5K reputation)SSCertifiable (5.5K reputation)SSCertifiable (5.5K reputation)SSCertifiable (5.5K reputation)SSCertifiable (5.5K reputation)

Group: General Forum Members
Points: 5517 Visits: 1133
I suggest using PowerShell when it comes to copying large files between your local/AWS. Use Write-s3object cmdlet to copy your .bak file after making the backup through SQL. You need to download Powershell for AWS

- Upload to S3
$s3Bucket = 'yourbucketnameinaws'
$backupPath = 'D:\BKUP_TEST_AWS\'
$region = 'us-east-1'
$accessKey = 'writeyourkeyhere'
$secretKey = 'writeyoursecretekeyhere'
$fileName = 'TEST_backup.bak'
$filePath = Join-Path $backupPath $fileName
Write-S3Object -BucketName $s3Bucket -File $filePath -Key $fileName -Region $region -AccessKey $accessKey -SecretKey $secretKey


I



EdVassie
EdVassie
SSC Guru
SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)SSC Guru (53K reputation)

Group: General Forum Members
Points: 53884 Visits: 3983
I have not tried it myself, but all of the syntax for backing up direct to an Azure blob looks like it should work with S3. It may be worth experimenting with it.

Original author: SQL Server FineBuild 1-click install and best practice configuration of SQL Server 2017 2016, 2014, 2012, 2008 R2, 2008 and 2005. 14 Mar 2017: now over 40,000 downloads.Disclaimer: All information provided is a personal opinion that may not match reality.Quote: When I give food to the poor they call me a saint. When I ask why they are poor they call me a communist. - Archbishop Hélder Câmara
lsalih
lsalih
SSCertifiable
SSCertifiable (5.5K reputation)SSCertifiable (5.5K reputation)SSCertifiable (5.5K reputation)SSCertifiable (5.5K reputation)SSCertifiable (5.5K reputation)SSCertifiable (5.5K reputation)SSCertifiable (5.5K reputation)SSCertifiable (5.5K reputation)

Group: General Forum Members
Points: 5517 Visits: 1133
EdVassie,

The script I posted works. I have uploaded about 750 GB of .bak files (backing up the SQL database to 12 .bak files) first to S3 storage, I used scriptblock start-job to transfer the .bak files in parallel. After the files are loaded to S3 storage, I then used Cloudberry Drive to map directly to S3 storage and run restore command in EC2 instance. We are implementing a DR plan to AWS.

I use SQL encryption when running the backup job locally so all files are encrypted, I also use -ServerSideEncryption AES256 parameter to enable server side encryption in S3. You do not need to unencrypt anything when you download the files again from S3 when server side encryption is used.



Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search