AWS Database Blog
Restore an Amazon RDS Custom for SQL Server instance using a backup from AWS Backup
Amazon Relational Database Service (Amazon RDS) Custom for SQL Server gives you the flexibility to customize your database environment while maintaining the benefits of a managed service. You have an option to bring your own licensed SQL Server media or use SQL Server Developer Edition, all while leveraging the time savings, durability, and scalability that come with a managed database service
AWS Backup supports the creation of on-demand backups of RDS Custom for SQL Server instances. However, the restoration of RDS Custom for SQL Server instances through AWS Backup is not natively supported at the time of writing this post. Nonetheless, this post presents a workaround solution that enables the successful restoration of RDS Custom for SQL Server instances using AWS Backup-created backups. This solution operates by first creating backups through AWS Backup, which appear as snapshots with an ‘awsbackup’ prefix in the Amazon RDS console, and then utilizing these snapshots with restore-db-instance-from-db-snapshot operation. This solution is particularly valuable for organizations that need to comply with long-term data retention policies, as it extends backup retention beyond the standard 35-day limit of Amazon RDS automated backups through configurable AWS Backup vault settings.
Solution overview
This post outlines the process for restoring an RDS Custom for SQL Server instance using a backup created by AWS Backup. You can implement the solution using either the Amazon RDS console or AWS Command Line Interface (AWS CLI) with restore-db-instance-from-db-snapshot. The complete procedure involves the following steps:
- Enable AWS Backup for Amazon RDS.
- Create an on-demand backup of an RDS Custom for SQL Server instance using AWS Backup.
- Restore the RDS Custom for SQL Server instance using the backup.
Prerequisites
Before you implement this solution, ensure you have the following prerequisites:
- An existing active RDS Custom for SQL Server instance from which you intend to create backups
- Working knowledge of AWS Backup
- Familiarity with the database snapshot restore process
- AWS Identity and Access Management (IAM) permissions to perform backup and restore operations using AWS Backup
Enable AWS Backup for Amazon RDS
Complete the following steps to enable AWS Backup for Amazon RDS:
- On the AWS Backup console, choose Settings under My account in the navigation pane.
- Choose Configure resources.
- On the Configure resources page, locate the RDS resource type and enable it.
- Choose Confirm to save your configuration changes.
Create an on-demand backup of an RDS Custom for SQL Server instance
Complete the following steps to take an on-demand backup of an RDS Custom for SQL Server instance using AWS Backup:
- On the AWS Backup console, choose Protected resources under My account in the navigation pane.
- Choose Create an on-demand backup.
- For Resource type, choose the resource type that you want to back up. For example, choose RDS for Amazon RDS.
- For Database name, choose your RDS Custom for SQL Server instance (for example, rds-cfs-instance).
- For Backup window, select Create backup now. This setting enables the immediate creation of a backup, rather than scheduling the job for a later time.
- For Total retention period, specify the desired retention duration (for example, choose Forever for indefinite retention). AWS Backup automatically manages deletion based on your retention settings.
- For Backup vault, choose an existing vault (such as Default vault) or create a new AWS Backup vault if required.Choosing Create new Backup vault opens a new page to create a vault and then returns you to the Create on-demand backup page when you are finished.
- For IAM role, select Default role for AWS Backup to use for this operation.
- Choose Create on-demand backup.
You will be redirected to the Jobs page, where you can monitor the progress of your backup job.
Alternatively, you can initiate this backup operation using the AWS CLI command start-backup-job:
Monitor backup progress
From the Jobs page of the AWS Backup console, select the backup job ID associated with your RDS Custom for SQL Server instance. The detailed view allows you to:
- View the backup job ID
- Check the status of your backup
- Monitor for warnings or errors
The backup job details page provides important information such as creation time and resource details that you might need for future reference or troubleshooting.
Restore the RDS Custom for SQL Server instance using the backup
Backups created by AWS Backup are also visible on the Snapshots page of the Amazon RDS console, on the Backup Service tab. These backups can be identified by their unique AWS Backup job identifier prefix awsbackup:job-XXXXXXXXXX-*
.
To perform a snapshot restore, complete the following steps:
- On the Amazon RDS console, choose Snapshots in the navigation pane.
- On the Backup service snapshots tab, select the snapshot (awsbackup:job-XXXXXXXXXX-b0c71179dfd9).
- On the Actions menu, choose Restore snapshot.
- To initiate the snapshot restore operation, you must provide several required input parameters. These typically include the target instance identifier, instance class, storage type, and network settings.
- After specifying these parameters, initiate the restore process.
Upon completion, a new RDS Custom for SQL Server instance (such as snapshot-restore-for-cfs-instance) will be created based on the selected AWS Backup snapshot awsbackup:job-XXXXXXXXXX-b0c71179dfd9.
Alternatively, you can initiate the restore operation using the AWS CLI command restore-db-instance-from-db-snapshot
:
Clean up
If you no longer need your RDS Custom for SQL Server instance, it is recommended to delete the instance to avoid incurring additional costs. Complete the following steps to clean up your resources:
Conclusion
In this post, we’ve demonstrated how to leverage AWS Backup to create on-demand backups of RDS Custom for SQL Server instances and use those backups to perform snapshot restores. This solution enables you to extend your backup retention beyond the standard 35-day limit, helping you meet long-term compliance requirements while maintaining the benefits of a managed database service. By combining the flexibility of RDS Custom with the powerful features of AWS Backup, you can create a robust, customizable backup strategy that aligns with your specific business needs. We encourage you to implement this solution in your environment and explore how it can enhance your data protection and retention capabilities.
Try out the solution for your use case, and share your feedback in the comments.