We all have been there where you get to know the pain of restoring a database from backups makes you hate all databases in the world, which is most the time not as easy as backing it up. To make things worse when I wanted to find a way to backup / restore AWS RDS database like my on premise SQL Server, I couldn’t find a flawless way to do it. If you are like me, who wants to do it with the best way possible, this is for you.
Setting up for native backup and restore
To setup native backup for AWS RDS SQL Server, follow this steps we share you below.
To set up for native backup and restore, you need three components:
-
The
SQLSERVER_BACKUP_RESTORE
option added to an option group on your DB instance. - An AWS Identity and Access Management (IAM) role to access the bucket.
- An Amazon S3 bucket to store your backup files.
Create an option group to backup/restore database In option groups, click on Create Group.
Setting up for native backup and restore
You can settup native backup and restore with this 3 steps:
-
The
SQLSERVER_BACKUP_RESTORE
option added to an option group on your DB instance. -
An AWS Identity and Access Management (IAM) role to access the bucket.
- An Amazon S3 bucket to store your backup files.
Create an option group to backup/restore database In option groups, click on Create Group.
To set up for native backup and restore, you need three components:
Give a name, description, engine and engine version. Here the engine should be the edition of your AWS SQL server instance. And the version should be same as the version you specified when you created the instance.
Now come back to RDS and select the newly created option group. Once the option group is created select it, and click on Add option.

Add option group to aws rds sql server
In the next screen Select the option “SQLSERVER_BACKUP_RESTORE” from the drop down list. It should be already selected.

create option group to database.
Down below, select the S3 bucket that you have created, Select “Yes” to “Apply immediately”. Then click “Add Option”.
You have to create a policy for the IAM Role: Backup-restore we have just created.
{
“Version”: “2012-10-17”,
“Statement”:
[
{
“Effect”: “Allow”,
“Action”:
[
“s3:ListBucket”,
“s3:GetBucketLocation”
],
“Resource”: “arn:aws:s3:::realworld-database”
},
{
“Effect”: “Allow”,
“Action”:
[
“s3:GetObjectAttributes”,
“s3:GetObject”,
“s3:PutObject”,
“s3:ListMultipartUploadParts”,
“s3:AbortMultipartUpload”
],
“Resource”: “arn:aws:s3:::realworld-database/*”
}
]
}

Create an iam role policy
Now go the Databases, select the database that you want to get restored from the S3 bucket. Click on “Modify” from the upper right corner.
The select apply immediately, to aplly the changes right now.
Now open up SQL Server Management Studio, Connect to your AWS RDS database instance and open a new query window.
Then Run this querys to backup / restore database:
SQL SERVER Query to backup the database:
exec msdb.dbo.rds_backup_database
@source_db_name=’realworld’,
@s3_arn_to_backup_to=’arn:aws:s3:::realworld/DataBase/backup.bak’,
@number_of_files=1;
SQL SERVER Query to restore the database:
exec msdb.dbo.rds_restore_database
@restore_db_name=’realworld’,
@s3_arn_to_restore_from=’arn:aws:s3:::realworld/DataBase/backup.bak’;
SQL SERVER Query to verify if the task is running:
exec msdb.dbo.rds_task_status @db_name=’realworld’;
If you want a consulting, support and benefits on how to implement and get started with this solution for your business and development, contact us today:
Website: http://cybershop46.com