- Newest
- Most votes
- Most comments
It sounds like you've set up the SQLSERVER_BACKUP_RESTORE option correctly, but you might be missing a step in the actual backup process. Adding the option to your option group and associating an IAM role with S3 bucket access only enables the native backup and restore functionality - it doesn't automatically create .bak files in your S3 bucket.
To create a .bak file in your S3 bucket, you need to explicitly run the backup command using the RDS stored procedure. Try running the following SQL command:
exec msdb.dbo.rds_backup_database
@source_db_name='your_database_name',
@s3_arn_to_backup_to='arn:aws:s3:::your_bucket_name/your_backup_filename.bak',
@overwrite_S3_backup_file=1;
Make sure to replace 'your_database_name', 'your_bucket_name', and 'your_backup_filename.bak' with your actual values.
If you're still encountering issues, check the following:
-
Verify that your IAM role has the correct permissions to access the S3 bucket (s3:ListBucket, s3:GetBucketLocation, s3:GetObjectAttributes, s3:GetObject, s3:PutObject, s3:ListMultipartUploadParts, s3:AbortMultipartUpload).
-
Ensure that your S3 bucket is in the same AWS Region as your RDS instance.
-
Confirm that the IAM role is properly associated with your option group and that the option group is applied to your DB instance.
-
Check that you're using the master user account when executing the backup stored procedure, as permission issues can prevent successful backups.
Sources
Support for native backup and restore in SQL Server - Amazon Relational Database Service
Setting up for native backup and restore - Amazon Relational Database Service
Migrate DBs from EC2 or on-premises to RDS SQL Server | AWS re:Post
Troubleshooting - Amazon Relational Database Service
answered a year ago
Hello,
I understand that you have created an Options groups with adding SQLSERVER_Backup_Restore and have an I AM Role with an S3 Bucket. However, it is not creating the .bak file for S3 storage.
Kindly note that, Adding the option to your option group and associating an IAM role with S3 bucket access only enables the native backup and restore functionality - it doesn't automatically create .bak files in your S3 bucket.
To create a .bak file in your S3 bucket, you need to explicitly run the backup command using the RDS stored procedure. Try running the following SQL command:
exec msdb.dbo.rds_backup_database @source_db_name='database_name', @s3_arn_to_backup_to='arn:aws:s3:::bucket_name/file_name.extension', - (Optional use .bak as extension) [@kms_master_key_arn='arn:aws:kms:region:account-id:key/key-id'], [@overwrite_s3_backup_file=0|1], [@block_size=512|1024|2048|4096|8192|16384|32768|65536], [@max_transfer_size=n], [@buffer_count=n], [@type='DIFFERENTIAL|FULL'], [@number_of_files=n];
Make sure to replace 'database_name', 'bucket_name', and 'filename.extension with your actual values.
- @source_db_name – The name of the database to back up.
- @s3_arn_to_backup_to – The ARN indicating the Amazon S3 bucket to use for the backup, plus the name of the backup file. The file can have any extension, but .bak is usually used.
Please refer the following documentation to understand the details on Using Native Backups and Restore : [+] https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/SQLServer.Procedural.Importing.Native.Using.html
If you're still encountering issues, please check the following:
- Verify that your IAM role has the correct permissions to access the S3 bucket (s3:ListBucket, s3:GetBucketLocation, s3:GetObjectAttributes, s3:GetObject, s3:PutObject, s3:ListMultipartUploadParts, s3:AbortMultipartUpload).
- Ensure that your S3 bucket is in the same AWS Region as your RDS instance.
- Confirm that the IAM role is properly associated with your option group and that the option group is applied to your DB instance.
- Check that you're using the master user account when executing the backup stored procedure, as permission issues can prevent successful backups.
Or please provide us any specific error message you’ve encountered while executing the above command by opening an AWS support case for additional troubleshooting and accurate resolution.
Relevant content
asked 3 years ago
- AWS OFFICIALUpdated 8 months ago

Do you run the command on SQL or on the CloudShell?