RDS DB snapshots are snapshots created from Amazon RDS DB instances. Those being MySQL, PostgreSQL, MariaDB, Oracle, and Microsoft SQL Server. Amazon Aurora also has snapshots, however, those are considered “cluster snapshots” and are handled differently.
The DB snapshots can be copied for longer data retention beyond the standard RDS instance snapshot lifetime, which maxes-out at 35 days. Also, the automated RDS snapshots are deleted when the RDS instance is deleted. So if you need to preserve your data after the instance is deleted, then you’ll need to make a copy of it yourself.
In this example, we’ll copy our RDS DB snapshot within the same region.
To copy RDS DB snapshots using the AWS Management Console, follow these steps.
Step 1: Find the snapshot that you want to copy, and select it by clicking the checkbox next to it’s name. You can select a “manual” snapshot, or one of the “automatic” snapshots that are prefixed by “rds:”.
Step 2: From the “Snapshot Actions” menu, select “Copy Snapshot”.
Step 3: On the page that appears:
Step 4: Wait for the snapshot to complete.
Once the copy is initiated, you should return to the RDS snapshots page. Your new snapshot should appear in the list with a status of “creating”. The snapshot’s status will become “available” once the copy process is complete.
If you want to copy your RDS DB snapshot using the AWS CLI, it can be done using the following command:
aws rds copy-db-snapshot \
--source-db-snapshot-identifier my-source-snapshot \
--target-db-snapshot-identifier target-snapshot
If you want to change the encryption key used for the snapshot copy, then you can add the --kms-key-id
argument.
aws rds copy-db-snapshot \
--source-db-snapshot-identifier my-source-snapshot \
--target-db-snapshot-identifier target-snapshot \
--kms-key-id 00000000-0000-0000-0000-000000000000
Once you want to start copying your DB snapshot into other AWS regions and/or AWS accounts, the commands get more complicated.
Start automating your RDS backups today by signing up for our 30 day free trial or sign-in to your Skeddly account to get started.