Backup and Restore SQL Server to Amazon RDS

Published on:

Backup and Restore SQL Server to Amazon RDS Instance

If you are using Amazon RDS, you can't backup and restore in the normal way
with SQL Server Management Studio.

You have to upload your .BAK file to S3 and then run one of the special stored
procedures documented here:

Once you have uploaded your .BAK file to S3 just run the following to restore it
to your RDS instance (the stored proc is already included in RDS).

exec msdb.dbo.rds_restore_database

-- Check the status. Make sure to use the correct task id returned by
-- the above stored proc.
exec msdb.dbo.rds_task_status @db_name='ydoyou', @task_id='2'

Backing up is just the reverse.

exec msdb.dbo.rds_backup_database

Below is a specific implementation of the instructions in the link above.

S3 Bucket


Upload your .BAK files to the some-s3-bucket S3 bucket and all will be well.

IAM Policy

The sql-server-backup IAM policy allows you to backup and restore SQL Server
.BAK files from the S3 bucket some-s3-bucket.


    "Version": "2012-10-17",
    "Statement": [
            "Effect": "Allow",
            "Action": [
            "Resource": [
            "Effect": "Allow",
            "Action": [
            "Resource": [

IAM Role


Create the sql-server-backup IAM role with one policy, sql-server-backup.

RDS Option Group


Create an option group called sqlserver-options. Make sure your RDS instance
uses this option group. You can specify this when you create the db or

The sqlserver-options option group must have an option named
SQLSERVER_BACKUP_RESTORE that points to the sql-server-backup IAM Role.

Thats all folks!