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

Copying a DB Snapshot

Use the procedures in this topic to copy a DB snapshot. For an overview of copying a snapshot, see Copying a DB Snapshot or DB Cluster Snapshot

If your source database engine is MariaDB, Microsoft SQL Server, MySQL, Oracle, or PostgreSQL, then your snapshot is a DB snapshot. If your source database engine is Aurora then your snapshot is a DB cluster snapshot. For instructions on how to copy a db cluster snapshot, see Copying a DB Cluster Snapshot.

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

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.

AWS Management Console

This procedure copies an encrypted or unencrypted DB snapshot, in the same region or across regions, by using the 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. Select the DB snapshot that you want to copy.

  4. Choose Snapshot Actions, and then choose Copy Snapshot. The Make Copy of DB Snapshot page appears.

    
							Copy a DB snapshot
  5. (Optional) To copy the DB snapshot to a different region, for Destination Region, choose the new region.

    Note

    The destination region must have the same database engine version available as the source region.

  6. For New DB Snapshot Identifier, type the name of the DB snapshot copy.

  7. (Optional) For Target Option Group, choose a new option group.

    Specify this option if you are copying a snapshot from one AWS region to another, and your DB instance uses a non-default option group. If your source DB instance uses Transparent Data Encryption for Oracle or Microsoft SQL Server, you must specify this option when copying across regions. For more information, see Option Group Considerations.

  8. (Optional) Select Copy Tags to copy tags and values from the snapshot to the copy of the snapshot.

  9. (Optional) For Enable Encryption, choose one of the following options:

    • Choose No if the DB snapshot isn't encrypted and you don't want to encrypt the copy.

    • Choose Yes if the DB snapshot isn't encrypted but you want to encrypt the copy. In this case, for Master Key, specify the KMS key identifier to use to encrypt the DB snapshot copy.

    • Choose Yes if the DB snapshot is encrypted. In this case, you must encrypt the copy, so Yes is already selected. For Master Key, specify the KMS key identifier to use to encrypt the DB snapshot copy.

  10. Choose Copy Snapshot.

CLI

You can copy a DB snapshot by using the AWS CLI command copy-db-snapshot. If you are copying the snapshot to a new region, run the command in the new region.

The following options are used to copy a DB snapshot. Not all options are required for all scenarios. Use the descriptions and the examples that follow to determine which options to use.

  • --source-db-snapshot-identifier – The identifier for the source DB snapshot.

    • If the source snapshot is in the same region as the copy, specify a valid DB snapshot identifier. For example, rds:mysql-instance1-snapshot-20130805.

    • If the source snapshot is in a different region than the copy, specify a valid DB snapshot ARN. For example, arn:aws:rds:us-west-2:123456789012:snapshot:mysql-instance1-snapshot-20130805.

    • If you are copying from a shared manual DB snapshot, this parameter must be the Amazon Resource Name (ARN) of the shared DB snapshot.

    • If you are copying an encrypted snapshot this parameter must be in the ARN format for the source region, and must match the SourceDBSnapshotIdentifier in the PreSignedUrl parameter.

  • --target-db-snapshot-identifier – The identifier for the new copy of the encrypted DB snapshot.

  • --copy-tags – Include the copy tags option to copy tags and values from the snapshot to the copy of the snapshot.

  • --option-group-name – The option group to associate with the copy of the snapshot.

    Specify this option if you are copying a snapshot from one AWS region to another, and your DB instance uses a non-default option group. If your source DB instance uses Transparent Data Encryption for Oracle or Microsoft SQL Server, you must specify this option when copying across regions. For more information, see Option Group Considerations.

  • --kms-key-id – The AWS KMS key ID for an encrypted DB snapshot. The KMS key ID is the Amazon Resource Name (ARN), KMS key identifier, or the KMS key alias for the KMS encryption key.

    • If you copy an encrypted DB snapshot from your AWS account, you can specify a value for this parameter to encrypt the copy with a new KMS encryption key. If you don't specify a value for this parameter, then the copy of the DB snapshot is encrypted with the same KMS key as the source DB snapshot.

    • If you copy an encrypted DB snapshot that is shared from another AWS account, then you must specify a value for this parameter.

    • If you specify this parameter when you copy an unencrypted snapshot, the copy is encrypted.

    • If you copy an encrypted snapshot to a different AWS region, then you must specify a KMS key for the destination AWS region. KMS encryption keys are specific to the region that they are created in, and you cannot use encryption keys from one region in another region.

  • --source-region – The ID of the region of the source DB snapshot. If you copy an encrypted snapshot to a different AWS region, then you must specify this option.

Example From Unencrypted, To Same Region

The following code creates a copy of snapshot, with the new name mydbsnapshotcopy, in the same region as the source snapshot. When the copy is made, all tags on the original snapshot are copied to the snapshot copy.

For Linux, OS X, or Unix:

Copy
aws rds copy-db-snapshot \ --source-db-snapshot-identifier mysql-instance1-snapshot-20130805 \ --target-db-snapshot-identifier mydbsnapshotcopy \ --copy-tags

For Windows:

Copy
aws rds copy-db-snapshot ^ --source-db-snapshot-identifier mysql-instance1-snapshot-20130805 ^ --target-db-snapshot-identifier mydbsnapshotcopy ^ --copy-tags

Example From Unencrypted, Across Regions

The following code creates a copy of snapshot, with the new name mydbsnapshotcopy, in the region in which the command is run.

For Linux, OS X, or Unix:

Copy
aws rds copy-db-snapshot \ --source-db-snapshot-identifier arn:aws:rds:us-east-1:123456789012:snapshot:mysql-instance1-snapshot-20130805 \ --target-db-snapshot-identifier mydbsnapshotcopy

For Windows:

Copy
aws rds copy-db-snapshot ^ --source-db-snapshot-identifier arn:aws:rds:us-east-1:123456789012:snapshot:mysql-instance1-snapshot-20130805 ^ --target-db-snapshot-identifier mydbsnapshotcopy

Example From Encrypted, Across Regions

The following code example copies an encrypted DB snapshot from the us-west-2 region in the us-east-1 region. Run the command in the us-east-1 region.

For Linux, OS X, or Unix:

Copy
aws rds copy-db-snapshot \ --source-db-snapshot-identifier arn:aws:rds:us-west-2:123456789012:snapshot:mysql-instance1-snapshot-20161115 \ --target-db-snapshot-identifier mydbsnapshotcopy \ --source-region us-west-2 \ --kms-key-id my-us-east-1-key \ --option-group-name custom-option-group-name

For Windows:

Copy
aws rds copy-db-snapshot ^ --source-db-snapshot-identifier arn:aws:rds:us-west-2:123456789012:snapshot:mysql-instance1-snapshot-20161115 ^ --target-db-snapshot-identifier mydbsnapshotcopy ^ --source-region us-west-2 ^ --kms-key-id my-us-east-1-key ^ --option-group-name custom-option-group-name

API

You can copy a DB snapshot by using the Amazon RDS API action CopyDBSnapshot. If you are copying the snapshot to a new region, perform the action in the new region.

The following parameters are used to copy a DB snapshot. Not all parameters are required for all scenarios. Use the descriptions and the examples that follow to determine which parameters to use.

  • SourceDBSnapshotIdentifier – The identifier for the source DB snapshot.

    • If the source snapshot is in the same region as the copy, specify a valid DB snapshot identifier. For example, rds:mysql-instance1-snapshot-20130805.

    • If the source snapshot is in a different region than the copy, specify a valid DB snapshot ARN. For example, arn:aws:rds:us-west-2:123456789012:snapshot:mysql-instance1-snapshot-20130805.

    • If you are copying from a shared manual DB snapshot, this parameter must be the Amazon Resource Name (ARN) of the shared DB snapshot.

    • If you are copying an encrypted snapshot this parameter must be in the ARN format for the source region, and must match the SourceDBSnapshotIdentifier in the PreSignedUrl parameter.

  • TargetDBSnapshotIdentifier – The identifier for the new copy of the encrypted DB snapshot.

  • CopyTags – Set this parameter to true to copy tags and values from the snapshot to the copy of the snapshot. The default is false.

  • OptionGroupName – The option group to associate with the copy of the snapshot.

    Specify this parametr if you are copying a snapshot from one AWS region to another, and your DB instance uses a non-default option group. If your source DB instance uses Transparent Data Encryption for Oracle or Microsoft SQL Server, you must specify this parameter when copying across regions. For more information, see Option Group Considerations.

  • KmsKeyId – The AWS KMS key ID for an encrypted DB snapshot. The KMS key ID is the Amazon Resource Name (ARN), KMS key identifier, or the KMS key alias for the KMS encryption key.

    • If you copy an encrypted DB snapshot from your AWS account, you can specify a value for this parameter to encrypt the copy with a new KMS encryption key. If you don't specify a value for this parameter, then the copy of the DB snapshot is encrypted with the same KMS key as the source DB snapshot.

    • If you copy an encrypted DB snapshot that is shared from another AWS account, then you must specify a value for this parameter.

    • If you specify this parameter when you copy an unencrypted snapshot, the copy is encrypted.

    • If you copy an encrypted snapshot to a different AWS region, then you must specify a KMS key for the destination AWS region. KMS encryption keys are specific to the region that they are created in, and you cannot use encryption keys from one region in another region.

  • PreSignedUrl – The URL that contains a Signature Version 4 signed request for the CopyDBSnapshot API action in the source AWS region that contains the source DB snapshot to copy.

    You must specify this parameter when you copy an encrypted DB snapshot from another AWS region by using the Amazon RDS API. You can specify the source region option instead of this parameter when you copy an encrypted DB snapshot from another AWS region by using the AWS CLI.

    The presigned URL must be a valid request for the CopyDBSnapshot API action that can be executed in the source region that contains the encrypted DB snapshot to be copied. The presigned URL request must contain the following parameter values:

    • DestinationRegion - The AWS Region that the encrypted DB snapshot will be copied to. This region is the same one where the CopyDBSnapshot action is called that contains this presigned URL.

      For example, if you copy an encrypted DB snapshot from the us-west-2 region to the us-east-1 region, then you will call the CopyDBSnapshot action in the us-east-1 region and provide a presigned URL that contains a call to the CopyDBSnapshot action in the us-west-2 region. For this example, the DestinationRegion in the presigned URL must be set to the us-east-1 region.

    • KmsKeyId - The KMS key identifier for the key to use to encrypt the copy of the DB snapshot in the destination region. This is the same identifier for both the CopyDBSnapshot action that is called in the destination region, and the action contained in the presigned URL.

    • SourceDBSnapshotIdentifier - The DB snapshot identifier for the encrypted snapshot to be copied. This identifier must be in the Amazon Resource Name (ARN) format for the source region. For example, if you are copying an encrypted DB snapshot from the us-west-2 region, then your SourceDBSnapshotIdentifier looks like the following example: arn:aws:rds:us-west-2:123456789012:snapshot:mysql-instance1-snapshot-20161115.

    To learn how to generate a Signature Version 4 signed request, see Authenticating Requests: Using Query Parameters (AWS Signature Version 4) and Signature Version 4 Signing Process.

Example From Unencrypted, To Same Region

The following code creates a copy of snapshot, with the new name mydbsnapshotcopy, in the same region as the source snapshot. When the copy is made, all tags on the original snapshot are copied to the snapshot copy.

Copy
https://rds.us-west-1.amazonaws.com/ ?Action=CopyDBSnapshot &CopyTags=true &SignatureMethod=HmacSHA256 &SignatureVersion=4 &SourceDBSnapshotIdentifier=mysql-instance1-snapshot-20130805 &TargetDBSnapshotIdentifier=mydbsnapshotcopy &Version=2013-09-09 &X-Amz-Algorithm=AWS4-HMAC-SHA256 &X-Amz-Credential=AKIADQKE4SARGYLE/20140429/us-west-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

Example From Unencrypted, Across Regions

The following code creates a copy of snapshot, with the new name mydbsnapshotcopy, in the region us-west-1.

Copy
https://rds.us-west-1.amazonaws.com/ ?Action=CopyDBSnapshot &SignatureMethod=HmacSHA256 &SignatureVersion=4 &SourceDBSnapshotIdentifier=arn%3Aaws%3Ards%3Aus-east-1%3A123456789012%3Asnapshot%3Amysql-instance1-snapshot-20130805 &TargetDBSnapshotIdentifier=mydbsnapshotcopy &Version=2013-09-09 &X-Amz-Algorithm=AWS4-HMAC-SHA256 &X-Amz-Credential=AKIADQKE4SARGYLE/20140429/us-west-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

Example From Encrypted, Across Regions

The following code creates a copy of snapshot, with the new name mydbsnapshotcopy, in the region in the us-east-1 region.

Copy
https://rds.us-east-1.amazonaws.com/ ?Action=CopyDBSnapshot &KmsKeyId=my-us-east-1-key &OptionGroupName=custom-option-group-name &PreSignedUrl=https%253A%252F%252Frds.us-west-2.amazonaws.com%252F %253FAction%253DCopyDBSnapshot %2526DestinationRegion%253Dus-east-1 %2526KmsKeyId%253Dmy-us-east-1-key %2526SourceDBSnapshotIdentifier%253Darn%25253Aaws%25253Ards%25253Aus-west-2%25253A123456789012%25253Asnapshot%25253Amysql-instance1-snapshot-20161115 %2526SignatureMethod%253DHmacSHA256 %2526SignatureVersion%253D4 %2526Version%253D2014-10-31 %2526X-Amz-Algorithm%253DAWS4-HMAC-SHA256 %2526X-Amz-Credential%253DAKIADQKE4SARGYLE%252F20161117%252Fus-west-2%252Frds%252Faws4_request %2526X-Amz-Date%253D20161117T215409Z %2526X-Amz-Expires%253D3600 %2526X-Amz-SignedHeaders%253Dcontent-type%253Bhost%253Buser-agent%253Bx-amz-content-sha256%253Bx-amz-date %2526X-Amz-Signature%253D255a0f17b4e717d3b67fad163c3ec26573b882c03a65523522cf890a67fca613 &SignatureMethod=HmacSHA256 &SignatureVersion=4 &SourceDBSnapshotIdentifier=arn%3Aaws%3Ards%3Aus-west-2%3A123456789012%3Asnapshot%3Amysql-instance1-snapshot-20161115 &TargetDBSnapshotIdentifier=mydbsnapshotcopy &Version=2014-10-31 &X-Amz-Algorithm=AWS4-HMAC-SHA256 &X-Amz-Credential=AKIADQKE4SARGYLE/20161117/us-east-1/rds/aws4_request &X-Amz-Date=20161117T221704Z &X-Amz-SignedHeaders=content-type;host;user-agent;x-amz-content-sha256;x-amz-date &X-Amz-Signature=da4f2da66739d2e722c85fcfd225dc27bba7e2b8dbea8d8612434378e52adccf