Amazon DocumentDB
Developer Guide

Copying a Cluster Snapshot

You can copy an Amazon DocumentDB (with MongoDB compatibility) automatic or manual snapshot to another account in the same region using the AWS Management Console or AWS CLI. Amazon DocumentDB does not currently support the ability to copy snapshots across regions.

Using the AWS Management Console

To make a copy of a snapshot

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

  2. In the navigation pane, choose Snapshots.

    Tip

    If you do not see the navigation pane on the left side of your screen, choose the menu icon () in the upper-left corner of the page.

  3. Locate the snapshot that you want to copy, and then choose the button to the left of its name.

  4. On the Actions menu, choose Copy.

  5. Complete the Settings section.

    
                     Screenshot: Copy snapshot screen, Settings pane.
    1. New snapshot identifier—Enter a name for the new snapshot.

      Target Snapshot Naming Constraints:
      • Cannot be the name of an existing snapshot.

      • The target snapshot must be in the same AWS Region as the source and be a valid snapshot identifier.

        • Length is [1–63] letters, numbers, or hyphens.

        • First character must be a letter.

        • Cannot end with a hyphen or contain two consecutive hyphens.

        • Must be unique for all clusters (across Amazon RDS, Amazon Neptune, and Amazon DocumentDB) per AWS account, per Region.

    2. Copy tags—To copy any tags you have on your source snapshot to your snapshot copy, choose Copy tags.

  6. Complete the Encryption-at-rest section.

    
                     Screenshot: Copy snapshot screen, Encryption pane.
    1. Encryption at rest—If your snapshot is encrypted, these options are not available to you because you cannot create an unencrypted copy from an encrypted snapshot. If your snapshot is not encrypted, choose one of the following:

      • To encrypt all your cluster's data, choose Enable encryption-at-rest. If you choose this option, you must designate a Master key.

      • To not encrypt your cluster's data, choose Disable encryption-at-rest. If you choose this option, your snapshot's copy data will not be encrypted, and you are finished with the encryption section.

    2. Master key—In the list, choose one of the following:

      • (default) aws/rds—The account number and AWS KMS key ID are listed following this option.

      • <some-key-name>—If you created a key, it is listed and available for you to choose.

      • Enter a key ARN—In the ARN box, enter the Amazon Resource Name (ARN) for your AWS KMS key. The format of the ARN is arn:aws:kms:<region>:<accountID>:key/<key-id> .

  7. Choose one of the following:

    • To make a copy of the selected snapshot, choose Copy snapshot.

    • To not make a copy of the snapshot, choose Cancel.

Using the AWS CLI

To make a copy of a cluster snapshot, use the copy-db-cluster-snapshot operation with the following parameters.

Parameters

  • --source-db-cluster-snapshot-identifier—Required. The identifier of the cluster snapshot to make a copy of. The cluster snapshot must exist and be in the available state. This parameter is not case sensitive.

    Source Snapshot Naming Constraints:
    • Must specify a valid system snapshot in the available state.

    • The source snapshot must be in the same AWS Region as the copy and be a valid snapshot identifier.

      • Length is [1–63] letters, numbers, or hyphens.

      • First character must be a letter.

      • Cannot end with a hyphen or contain two consecutive hyphens.

      • Must be unique for all clusters (across Amazon RDS, Amazon Neptune, and Amazon DocumentDB) per AWS account, per Region.

  • --target-db-cluster-snapshot-identifier—Required. The identifier of the new cluster snapshot to create from the source cluster snapshot. This parameter is not case sensitive.

    Target Snapshot Naming Constraints:
    • Cannot be the name of an existing snapshot.

    • The target snapshot must be in the same AWS Region as the source and be a valid snapshot identifier.

      • Length is [1–63] letters, numbers, or hyphens.

      • First character must be a letter.

      • Cannot end with a hyphen or contain two consecutive hyphens.

      • Must be unique for all clusters (across Amazon RDS, Amazon Neptune, and Amazon DocumentDB) per AWS account, per Region.

The following AWS CLI example makes a copy of sample-cluster-snapshot named sample-cluster-snapshot-copy.

For Linux, macOS, or Unix:

aws docdb copy-db-cluster-snapshot \ --source-db-cluster-snapshot-identifier sample-cluster-snapshot \ --target-db-cluster-snapshot-identifier sample-cluster-snapshot-copy

For Windows:

aws docdb copy-db-cluster-snapshot ^ --source-db-cluster-snapshot-identifier sample-cluster-snapshot ^ --target-db-cluster-snapshot-identifier sample-cluster-snapshot-copy

Output from this operation looks something like the following (JSON format).

{ "DBClusterSnapshot": { "AvailabilityZones": [ "us-east-1a", "us-east-1b", "us-east-1c", "us-east-1d", "us-east-1e", "us-east-1f" ], "VpcId": "vpc-91280df6", "ClusterCreateTime": "2018-11-05T21:01:18.946Z", "StorageEncrypted": true, "MasterUsername": "user-name", "Port": 0, "EngineVersion": "3.6.0", "Engine": "docdb", "SnapshotCreateTime": "2018-11-05T21:25:34.841Z", "SourceDBClusterSnapshotArn": "arn:aws:rds:us-east-1:012345678901:cluster-snapshot:sample-cluster-snapshot", "DBClusterSnapshotIdentifier": "sample-cluster-snapshot-copy", "DBClusterIdentifier": "sample-cluster", "DBClusterSnapshotArn": "arn:aws:rds:us-east-1:012345678901:cluster-snapshot:sample-cluster-snapshot-copy", "PercentProgress": 0, "KmsKeyId": "arn:aws:kms:us-east-1:012345678901:key/EXAMPLE-KMS-KEY-ID", "Status": "copying", "SnapshotType": "manual" } }