Skeddly Blog

Skeddly news and announcements...

Copying RDS DB Snapshots

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.

AWS Management Console

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:

  • Select the target region. In this case, we’re selecting the same region as the source snapshot.
  • Specify your new snapshot name in the “New DB Snapshot Identifier” field. This identifier must not already be used by a snapshot in the same region.
  • Check the “Copy Tags” checkbox if you want the tags on the source snapshot to be copied to the new snapshot.
  • Under “Encryption”, if your snapshot is encrypted, you can use the same KMS key, or choose another one. If your snapshot is not encrypted, you can choose to encrypt the copy by selecting a KMS key.
  • Click the “Copy Snapshot” button.

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.

AWS CLI and SDKs

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.

More on this later…

About Skeddly

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.

<