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


Trying to copy sql backups to AWS S3


Trying to copy sql backups to AWS S3

Author
Message
will_william
will_william
Grasshopper
Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)

Group: General Forum Members
Points: 22 Visits: 321
Hello -
We have weekly full and daily diff backups scheduled (created via a maintenance plan). The backups are created on a network share. There is a new requirement to also copy the backups to AWS S3.
I have a windows command that i can execute outside of the sql server job and it runs as expected and copies the backup files to our S3 bucket.

When I try to run from within a sql server job, it fails. I have tried various things like
- setting the %userprofile% to my user which has the aws credentials
- copying my aws credentials to the C:\Users\SQLSERVERAGENT
...and the aws command part of the windows .cmd script fail. I am just trying something simple at first:
aws s3 ls s3://mybucket/folder1/

The error message is:
('Connection aborted.', error(10060, 'A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'))

As i wrote, i can run the same .cmd file and it works every time.

Could this still be an issue with aws credentials? Or, any other suggestions?

thanks -
will
Alexander Zhang
Alexander Zhang
Valued Member
Valued Member (65 reputation)Valued Member (65 reputation)Valued Member (65 reputation)Valued Member (65 reputation)Valued Member (65 reputation)Valued Member (65 reputation)Valued Member (65 reputation)Valued Member (65 reputation)

Group: General Forum Members
Points: 65 Visits: 76
I'm pretty sure it's AWS credentials issue. I guess you use SAML/IAM Role to generate temp credential. MSSQL works in different security context. Means it can NOT use your credential. You can have a try to generate AWS credential in MSSQL context (for example, xp_cmdshell). BTW, to backup DB to AWS S3, good options might be AWS Storage Gateway or some 3rd backup tool.

GASQL.com - Focus on Database and Cloud
will_william
will_william
Grasshopper
Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)

Group: General Forum Members
Points: 22 Visits: 321
Hi...Thanks for the reply and suggestion.
will_william
will_william
Grasshopper
Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)

Group: General Forum Members
Points: 22 Visits: 321
Hi All -
Figured this out finally. I had to create a Sql Server Credential and Proxy. I used my account (just to test) as the one for the Credential. Then in the job step, i set the "Run As" to that proxy and it worked!
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