Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RDS server backup

My intention is to export an RDS database and load its data into a local MS-SQL database. I am getting the errors when trying to back-up the RDS instance.

The SQL statement used to initiate the backup is:

USE [msdb]
GO
DECLARE   @return_value int
EXEC  @return_value = [dbo].[rds_backup_database]
      @source_db_name = 'abcd',
      @S3_arn_to_backup_to = 'arn:aws:s3:::abcd/test_09_May.bak',
      @KMS_master_key_arn = NULL,
      @overwrite_S3_backup_file = NULL
SELECT    'Return Value' = @return_value
GO

The query to check the task status is:

exec msdb.dbo.rds_task_status
EXEC msdb.dbo.rds_task_status 
    @db_name = 'abcd', -- sysname
    @task_id = 7 -- int
exec msdb.dbo.rds_task_status @task_id = 7
exec msdb.dbo.rds_task_status @db_name='abcd'

The failure reasons from the taskinfo column are:

1. Aborted the task because of a task failure or an overlap with your preferred backup window for RDS automated backup.
A WebException with status ConnectFailure was thrown.

2. Aborted the task because of a task failure or an overlap with your preferred backup window for RDS automated backup.
Access Denied
like image 239
Debarshi DasGupta Avatar asked Dec 24 '22 18:12

Debarshi DasGupta


1 Answers

Both the issue are with respect to the S3 bucket:

For the first issue , the s3 bucket you are backing up is not in the same region as your RDS instance

For the second issue, the role that's being used in the Option group doesnt have permissions on the respective bucket. Go to Security Credentials -> Roles -> select the policy and then edit.

like image 99
hakuna Avatar answered Jan 12 '23 13:01

hakuna