Menu
Amazon Relational Database Service
User Guide (API Version 2014-10-31)

Copying a DB Snapshot or DB Cluster Snapshot

With Amazon Relational Database Service (Amazon RDS), you can copy a DB snapshot using one of these methods:

  • Copy an automated or manual DB snapshot to create a manual DB snapshot in the same AWS region.

  • Copy either an automated or manual DB snapshot from one region to another region.

  • Copy an automated or manual DB cluster snapshot (Aurora) to create a manual DB cluster snapshot in the same AWS region.

    You cannot copy a DB cluster snapshot to a different region.

To copy a DB snapshot, use the AWS Management Console, the copy-db-snapshot commmand, or the CopyDBSnapshot API action.

To copy an Amazon Aurora DB cluster snapshot, use the AWS Management Console, the copy-db-cluster-snapshot commmand, or the CopyDBClusterSnapshot API action.

If you create a manual DB snapshot or DB cluster snapshot, you can keep that snapshot indefinitely. However, automated snapshots are deleted after their retention period expires. Amazon RDS storage costs may apply to your snapshot backups. For information on backup storage costs, see Amazon RDS Pricing.

If you copy a DB snapshot to another AWS region, you create a manual DB snapshot that is retained in that region. To copy a DB snapshot to another AWS region, you can use the AWS Management Console, the copy-db-snapshot AWS CLI command, or the CopyDBSnapshot RDS API action.

  • To copy a DB snapshot to another AWS region by using the AWS Management Console, specify the Destination Region for the DB snapshot on the Make Copy of DB Snapshot page.

  • To copy a DB snapshot using the copy-db-snapshot CLI command or CopyDBSnapshot API action, issue the command in the AWS region that you want to copy the DB snapshot to, and then use an Amazon RDS Amazon Resource Name (ARN) to specify the source DB snapshot to be copied, including the source region. For information about Amazon RDS ARN formats, see Working with Amazon Resource Names (ARNs) in Amazon RDS.

Amazon RDS deletes automated snapshots either at the end of their retention period, when you disable automated snapshots for a DB instance or DB cluster, or when you delete a DB instance or DB cluster. If you want to keep an automated snapshot for a longer period, copy it to create a manual snapshot, which is retained until you delete it. Amazon RDS storage costs apply to snapshots that you retain after you delete a DB instance or DB cluster.

You can copy a snapshot that has been encrypted using an AWS Key Management System (AWS KMS) encryption key. If you copy an encrypted snapshot, the copy of the snapshot must also be encrypted. You can encrypt the snapshot with the same KMS encryption key as the original snapshot, or you can specify a different KMS encryption key to encrypt the copy of the snapshot.

You can also encrypt a copy of an unencrypted snapshot. This can be a quick way to add encryption to a previously unencrypted DB instance. That is, you can create a snapshot of your DB instance or DB cluster when you are ready to encrypt it, and then create a copy of that snapshot and specify a KMS encryption key to encrypt the copy of the snapshot. You can then restore an encrypted DB instance or DB cluster from the encrypted snapshot. You do not need to encrypt an Amazon Aurora DB cluster snapshot in order to create an encrypted copy of an Aurora DB cluster. If you specify a KMS encryption key when restoring from an unencrypted DB cluster snapshot, the restored DB cluster is encrypted using the specified KMS encryption key.

You can share manual snapshots with other AWS accounts and copy snapshots shared to you by other AWS accounts. For more information, see Sharing an Encrypted Snapshot.

Note

If you are copying an encrypted snapshot that has been shared from another AWS account, you must have access to the KMS encryption key that was used to encrypt the DB snapshot. You cannot copy encrypted snapshots from other regions. For more information, see Sharing an Encrypted Snapshot.

Copying a DB Snapshot to Another Region

For each AWS account, you can copy up to five DB snapshots at a time from one region to another. Copying a snapshot out of the source region incurs Amazon RDS data transfer charges. For more information about Amazon RDS data transfer pricing, go to Amazon Relational Database Service Pricing.

Note

Because KMS encryption keys are specific to the region that they are created in, you cannot copy an encrypted snapshot from one region to another.

Depending on the regions involved and the amount of data to be copied, a cross-region snapshot can take hours to complete. If there are large numbers of cross-region DB snapshot copy requests from a given source region, Amazon RDS might queue new cross-region copy requests for that source region until some of the in-progress copies have completed. No progress information is displayed about copy requests while they are in the queue. Progress information is displayed when the copy starts.

After the DB snapshot copy has been created in the new region, the DB snapshot copy behaves the same as all other DB snapshots in that region. For example, the following CLI copy command results in a DB snapshot in the us-west-2 region with the identifier mysql-instance1-snapshot-20130805-copy.

For Linux, OS X, or Unix:

aws rds copy-db-snapshot \
    --source-db-snapshot-identifier arn:aws:rds:us-east-1:123456789012:snapshot:mysql-instance1-snapshot-20130805 \
    --region us-west-2 \
    --target-db-snapshot-identifier mysql-instance1-snapshot-20130805-copy 

For Windows:

aws rds copy-db-snapshot ^
    --source-db-snapshot-identifier arn:aws:rds:us-east-1:123456789012:snapshot:mysql-instance1-snapshot-20130805 ^
    --region us-west-2 ^
    --target-db-snapshot-identifier mysql-instance1-snapshot-20130805-copy 

When the copy is finished, the AWS Management Console shows the DB snapshot with the name mysql-instance1-snapshot-20130805-copy in your list of DB snapshots in us-west-2. You can perform all DB snapshot actions by using the DB snapshot identifier. For example, running the following CLI command in the us-west-2 region will create a new DB instance with data from the DB snapshot copy:

For Linux, OS X, or Unix:

aws rds restore-db-instance-from-db-snapshot \
    --db-instance-identifier mysql-instance1-west \
    --region us-west-2 \
    --db-snapshot-identifier mysql-instance1-snapshot-20130805-copy 

For Windows:

aws rds restore-db-instance-from-db-snapshot ^
    --db-instance-identifier mysql-instance1-west ^
    --region us-west-2 ^
    --db-snapshot-identifier mysql-instance1-snapshot-20130805-copy 

There are some limitations to how and where you can copy DB snapshots:

  • You cannot copy a DB snapshot to or from the AWS GovCloud (US) region.

  • You cannot copy a DB snapshot across regions if it was created from a DB instance that is using Oracle Transparent Data Encryption (TDE) or Microsoft SQL Server TDE.

  • You cannot copy a SQL Server DB snapshot across regions if the DB snapshot was created from an instance using Multi-AZ mirroring.

A snapshot copied across regions doesn't include either the parameter group or option group that was used by the DB instance the snapshot was created from. When you restore a snapshot to create a new DB instance, that DB instance is assigned the default parameter group and default option group for the region it is created in. To give the new DB instance the same parameters and options as the source, you must do the following:

  1. In the destination region, create a parameter group with the same settings as the parameter group used by the source DB instance, or note the name of an existing parameter group that has those settings.

  2. In the destination region, create an option group with the same settings as the option group used by the source DB instance, or note the name of an existing option group that has those settings.

  3. After restoring the snapshot in the destination region, modify the new DB instance to add the parameter group and option group available in the destination region.

AWS Management Console

To copy a DB snapshot

  1. Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/.

  2. In the navigation pane, choose Snapshots.

  3. Set Filter to Automated Snapshots.

    Select the check box for the automated DB snapshot you want to copy.

    Choose Copy Snapshot

    The Copy DB Snapshot window appears.

  4. Verify that the name of the automated DB snapshot you want to copy appears in Source DB Snapshot.

    To copy the DB snapshot to a different region, choose that region for Destination Region.

    Type the name of the DB snapshot copy in New DB Snapshot Identifier.

    To copy tags and values from the snapshot to the copy of the snapshot, choose Copy Tags.

    Copy a DB snapshot

    To encrypt the copied DB snapshot, choose Yes for Enable Encryption, and then specify the KMS key identifier to use to encrypt the copied DB snapshot for Master Key.

    Copy and encrypt a DB snapshot

    If the DB snapshot being copied is encrypted, specify the KMS key identifier for the KMS encryption key that will be used to encrypt the DB snapshot as the Master Key.

    Copy an encrypted a DB snapshot
  5. Choose Yes, Copy Snapshot.

CLI

To copy a DB snapshot, use the AWS CLI copy-db-snapshot command. (To copy an Amazon Aurora DB cluster snapshot, use the copy-db-cluster-snapshot commmand. You cannot copy Aurora DB cluster snapshots to different regions.) The following parameters are required:

  • --source-db-snapshot-identifier

  • --target-db-snapshot-identifier

Example

The following code makes a copy of the snapshot rds:mydbinstance-2013-09-04-22-50 named mydbsnapshotcopy. When the copy is made all tags on the original snapshot are copied to the snapshot copy.

For Linux, OS X, or Unix:

aws rds copy-db-snapshot \
    --source-db-snapshot-identifier rds:mydbinstance-2013-09-04-22-50 \
    --target-db-snapshot-identifier mydbsnapshotcopy \
    --copy-tags

For Windows:

aws rds copy-db-snapshot ^
    --source-db-snapshot-identifier rds:mydbinstance-2013-09-04-22-50 ^
    --target-db-snapshot-identifier mydbsnapshotcopy ^
    --copy-tags

The output from this command should look similar to the following:

DBSNAPSHOT  mydbsnapshotcopy  2013-09-04T22:51:29.982Z  mydbinstance  2013-09-04T22:50:22.355Z  mysql  5  available  MasterUser
default:mysql-5-6  5.6.12  general-public-license  manual

API

To copy a DB snapshot, use the Amazon RDS API CopyDBSnapshot action. (To copy an Amazon Aurora DB cluster snapshot, use the CopyDBClusterSnapshot API action. You cannot copy Aurora DB cluster snapshots to different regions.) The following parameters are required:

  • SourceDBSnapshotIdentifier = arn%3Aaws%3Ards%3Aus-east-1%3A815981987263%3Asnapshot%3Ards%3Amysqldb-2014-04-27-08-15

  • TargetDBSnapshotIdentifier = mydbsnapshotcopy

Example

https://rds.us-east-1.amazonaws.com/
   ?Action=CopyDBSnapshot
   &CopyTags=true
   &SignatureMethod=HmacSHA256
   &SignatureVersion=4
   &SourceDBSnapshotIdentifier=arn%3Aaws%3Ards%3Aus-east-1%3A815981987263%3Asnapshot%3Ards%3Amysqldb-2014-04-27-08-15
   &TargetDBSnapshotIdentifier=mydbsnapshotcopy
   &Version=2013-09-09
   &X-Amz-Algorithm=AWS4-HMAC-SHA256
   &X-Amz-Credential=AKIADQKE4SARGYLE/20140429/us-east-1/rds/aws4_request
   &X-Amz-Date=20140429T175351Z
   &X-Amz-SignedHeaders=content-type;host;user-agent;x-amz-content-sha256;x-amz-date
   &X-Amz-Signature=9164337efa99caf850e874a1cb7ef62f3cea29d0b448b9e0e7c53b288ddffed2