

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 複製 Amazon DocumentDB 叢集快照
<a name="backup_restore-copy_cluster_snapshot"></a>

在 Amazon DocumentDB 中，您可以在相同 AWS 區域 或不同的 中複製快照 AWS 區域。您也可以將共用快照複製到相同 AWS 區域 或不同的 帳戶中 AWS 區域。如需有關共用快照的詳細資訊，請參閱 [共用 Amazon DocumentDB 叢集快照](backup_restore-share_cluster_snapshots.md)。

**注意**  
Amazon DocumentDB 會根據您保留的備份和快照資料量，以及您保留資料的期間向您收費。如需與 Amazon DocumentDB 備份和快照相關聯之儲存體的詳細資訊，請參閱 [了解 備份儲存體用量](backup_restore-understanding_backup_storage_usage.md)。如需 Amazon DocumentDB 儲存體的定價資訊，請參閱 [Amazon DocumentDB 定價](https://aws.amazon.com/documentdb/pricing/)。

**Topics**
+ [複製共用快照](#backup_restore-copy_shared_cluster_snapshot)
+ [跨 複製快照 AWS 區域](#backup_restore-copy_snapshot_across_regions)
+ [限制](#backup_restore-copy_cluster_snapshot-limitations)
+ [處理加密](#backup_restore-copy_cluster_snapshot-handle_encryption)
+ [參數群組考量](#backup_restore-copy_cluster_snapshot-parameter_group_considerations)
+ [複製叢集快照](#backup_restore-copy_a_cluster_snapshot)

## 複製共用快照
<a name="backup_restore-copy_shared_cluster_snapshot"></a>

您可以複製其他 AWS 帳戶共用給您的快照。如果您要複製已從另一個 AWS 帳戶共用的加密快照，您必須能夠存取用來加密快照的 AWS KMS 加密金鑰。如需詳細資訊，請參閱[處理加密](#backup_restore-copy_cluster_snapshot-handle_encryption)。

## 跨 複製快照 AWS 區域
<a name="backup_restore-copy_snapshot_across_regions"></a>

當您將快照複製到與來源快照 AWS 區域 不同的 時 AWS 區域，每個複本都是完整快照。完整快照複本包含還原 Amazon DocumentDB 叢集所需的所有資料和中繼資料。

## 限制
<a name="backup_restore-copy_cluster_snapshot-limitations"></a>

以下是複製快照時的一些限制：
+ 如果您在目標快照變成可用之前刪除來源快照，則快照複製可能會失敗。刪除來源快照之前，請確認目標快照的狀態為 `AVAILABLE`。
+ 對於單一目的地區域，每一帳戶最多可有 5 個快照複製請求在進行中。
+ 根據 AWS 區域 涉及的內容和要複製的資料量，跨區域快照複本可能需要數小時才能完成。在某些情況下，可能會有來自指定來源的大量跨區域快照複製請求 AWS 區域。在這些情況下，Amazon DocumentDB 可能會將來自該來源的新跨區域複製請求 AWS 區域 放入佇列，直到某些進行中的複本完成為止。位於佇列中的複製請求不會顯示進度資訊。複製開始時才會顯示進度資訊。

## 處理加密
<a name="backup_restore-copy_cluster_snapshot-handle_encryption"></a>

您可以複製以 AWS KMS 加密金鑰所加密的快照。如果您複製加密快照，則快照的副本也必須加密。如果您在相同的 中複製加密快照 AWS 區域，您可以使用與原始快照相同的 AWS KMS 加密金鑰來加密複本，也可以指定不同的 AWS KMS 加密金鑰。如果您跨區域複製加密快照，則無法對副本使用與來源快照相同的 AWS KMS 加密金鑰，因為 AWS KMS 金鑰是區域特定的。反之，您必須在目的地 n AWS 區域中指定有效的 AWS KMS 金鑰。

在整個複製過程中來源快照仍會保持加密狀態。如需詳細資訊，請參閱[Amazon DocumentDB 中的資料保護](security.data-protection.md)。

**注意**  
對於 Amazon DocumentDB 叢集快照，您無法在複製快照時加密未加密的叢集快照。

## 參數群組考量
<a name="backup_restore-copy_cluster_snapshot-parameter_group_considerations"></a>

當您跨區域複製快照時，複本不包含原始 Amazon DocumentDB 叢集所使用的參數群組。當您還原快照以建立新的叢集時，該叢集會取得 AWS 區域 其建立所在 的預設參數群組。若要為新叢集提供與原始叢集相同的參數，您必須執行下列動作：

1. 在目的地中 AWS 區域，使用與原始[叢集相同的設定建立 Amazon DocumentDB 叢集參數群組](https://docs.aws.amazon.com/documentdb/latest/developerguide/cluster_parameter_groups-create.html)。如果新的 中已存在， AWS 區域您可以使用該項目。

1. 在目的地還原快照後 AWS 區域，請修改新的 Amazon DocumentDB 叢集，並從上一個步驟新增新的或現有的參數群組。如需詳細資訊，請參閱[修改 Amazon DocumentDB 叢集](db-cluster-modify.md)。

## 複製叢集快照
<a name="backup_restore-copy_a_cluster_snapshot"></a>

您可以使用 AWS 管理主控台 或 複製 Amazon DocumentDB 叢集 AWS CLI，如下所示。

------
#### [ Using the AWS 管理主控台 ]

若要使用 複製叢集快照 AWS 管理主控台，請完成下列步驟。此程序適用於在相同區域或 AWS 區域 跨區域中複製加密或未加密的叢集快照。

1. 登入 AWS 管理主控台，並在 [https://console.aws.amazon.com/docdb](https://console.aws.amazon.com/docdb)：// 開啟 Amazon DocumentDB 主控台。

1. 在導覽窗格中，選擇**快照**，然後選擇您要複製之快照左側的按鈕。
**提示**  
如果畫面左側沒有出現導覽窗格，請選擇頁面左上角的功能表圖示 (![\[Hamburger menu icon with three horizontal lines.\]](http://docs.aws.amazon.com/zh_tw/documentdb/latest/developerguide/images/docdb-menu-icon.png))。

1. 從 **Actions** (動作) 功能表中，選擇 **Copy** (複製)。

1. 在產生的**建立叢集快照複本**頁面中，完成**設定**區段。

   1. **目的地區域** — 選用。若要將叢集快照複製到不同的 AWS 區域，請 AWS 區域 針對**目的地區域**選擇該快照。

   1. **新快照識別符** — 輸入新快照的名稱。

      目標快照命名限制條件：
      + 不能是現有快照的名稱。
      + 長度為 【1-63】 個字母、數字或連字號。
      + 第一個字元必須是字母。
      + 不能以連字號結尾，或包含兩個連續連字號。
      + 對於每個區域每個 Amazon RDS、Neptune 和 Amazon DocumentDB 的所有叢集 AWS 帳戶，必須是唯一的。

   1. **複製標籤** — 若要將來源快照上擁有的任何標籤複製到快照複本，請選擇**複製標籤**。

1. 填妥 **Encryption-at-rest (靜態加密)** 部分。

   1. **靜態加密** — 如果您的快照未加密，您將無法使用這些選項，因為您無法從未加密的快照建立加密的副本。如果您的快照已加密，您可以變更靜態加密期間 AWS KMS key 使用的 。

      如需加密快照複本的詳細資訊，請參閱 [複製叢集快照加密](backup_restore-cluster_snapshot_considerations.md#backup_restore-encryption)。

      如需靜態加密的詳細資訊，請參閱 [加密靜態 Amazon DocumentDB 資料](encryption-at-rest.md)。

   1. **AWS KMS 金鑰** — 從下拉式清單中，選擇下列其中一項：
      + **（預設） aws/rds** — 帳戶號碼和 AWS KMS 金鑰 ID 會列在此選項後面。
      + **<some-key-name>** — 如果您建立金鑰，則會列出它並供您選擇。
      + **輸入金鑰 ARN** — 在 **ARN** 方塊中，輸入 AWS KMS 金鑰的 Amazon Resource Name (ARN)。ARN 的格式是 `arn:aws:kms:<region>:<accountID>:key/<key-id> `。

1. 若要製作所選快照的複本，請選擇 **Copy snapshot (複製快照)**。或者，您可以選擇**取消**，不複製快照。

------
#### [ Using the AWS CLI ]

若要使用 複製未加密的叢集快照 AWS CLI，請使用 `copy-db-cluster-snapshot`操作搭配下列參數。如果您要將快照複製到另一個快照 AWS 區域，請在要複製快照 AWS 區域 的 中執行 命令。
+ **--source-db-cluster-snapshot-identifier** – 必要。要製作複本之叢集快照的識別碼。叢集快照必須存在且位於可用狀態。如果您要將快照複製到另一個快照， AWS 區域 或要複製共用叢集快照，則此識別符必須是來源叢集快照的 ARN 格式。此參數不區分大小寫。
+ **--target-db-cluster-snapshot-identifier** – 必要。要從來源叢集快照建立之新叢集快照的識別碼。此參數不區分大小寫。

  目標快照命名限制條件：
  + 不能是現有快照的名稱。
  + 長度為 【1-63】 個字母、數字或連字號。
  + 第一個字元必須是字母。
  + 不能以連字號結尾，或包含兩個連續連字號。
  + 對於每個區域每個 Amazon RDS、Neptune 和 Amazon DocumentDB 的所有叢集 AWS 帳戶，必須是唯一的。
+ **--source-region** — 如果您要將快照複製到另一個快照 AWS 區域，請指定要從中複製加密叢集快照 AWS 區域 的 。

  如果您要將快照複製到另一個 AWS 區域 ，但未指定 `--source-region`，則必須改為指定 `pre-signed-url`選項。此`pre-signed-url`值必須是 URL，其中包含簽章第 4 版簽署的請求，以便在複製叢集快照 AWS 區域 的來源中呼叫`CopyDBClusterSnapshot`動作。若要進一步了解 `pre-signed-url`，請參閱 [ CopyDBClusterSnapshot](https://docs.aws.amazon.com/documentdb/latest/developerguide/API_CopyDBClusterSnapshot.html)。
+ **--kms-key-id** — 金鑰的 KMS 金鑰識別符，用於加密叢集快照的副本。

  如果您要將加密的叢集快照複製到另一個快照 AWS 區域，則需要此參數。您必須指定目的地的 KMS 金鑰 AWS 區域。

  如果您要在相同的 中複製加密叢集快照 AWS 區域，則 AWS KMS 金鑰參數為選用。叢集快照的副本會使用與來源叢集快照相同的 AWS KMS 金鑰加密。如果您想要指定用來加密複本的新 AWS KMS 加密金鑰，您可以使用此參數執行此操作。
+ **--copy-tags** — 選用。要複製的標籤和值。

若要在複製操作進行時取消複製操作，您可以刪除由 識別的目標叢集快照，`--target-db-cluster-snapshot-identifier`或在叢集快照處於**複製**狀態`TargetDBClusterSnapshotIdentifier`時刪除。

**Example**  
**範例 1：將未加密快照複製到相同的區域**  
下列 AWS CLI 範例會在 AWS 區域 與來源快照相同的 `sample-cluster-snapshot-copy`中建立`sample-cluster-snapshot`名為 的複本。建立副本時，原始快照的所有標籤會複製到快照副本。  
針對 Linux、macOS 或 Unix：  

```
aws docdb copy-db-cluster-snapshot \
    --source-db-cluster-snapshot-identifier sample-cluster-snapshot \
    --target-db-cluster-snapshot-identifier sample-cluster-snapshot-copy \
    --copy-tags
```
針對 Windows：  

```
aws docdb copy-db-cluster-snapshot ^
    --source-db-cluster-snapshot-identifier sample-cluster-snapshot ^
    --target-db-cluster-snapshot-identifier sample-cluster-snapshot-copy ^
    --copy-tags
```
此操作的輸出將會如下所示。  

```
{
    "DBClusterSnapshot": {
        "AvailabilityZones": [
            "us-east-1a",
            "us-east-1b",
            "us-east-1c"
        ],
        "DBClusterSnapshotIdentifier": "sample-cluster-snapshot-copy",
        "DBClusterIdentifier": "sample-cluster",
        "SnapshotCreateTime": "2020-03-27T08:40:24.805Z",
        "Engine": "docdb",
        "Status": "copying",
        "Port": 0,    
        "VpcId": "vpc-abcd0123",
        "ClusterCreateTime": "2020-01-10T22:13:38.261Z",
        "MasterUsername": "master-user",
        "EngineVersion": "4.0.0",
        "SnapshotType": "manual",
        "PercentProgress": 0,
        "StorageEncrypted": true,
        "KmsKeyId": "arn:aws:kms:us-east-1:111122223333:key/sample-key-id",
        "DBClusterSnapshotArn": "arn:aws:rds:us-east-1:111122223333:cluster-snapshot:sample-cluster-snapshot-copy",
        "SourceDBClusterSnapshotArn": "arn:aws:rds:us-east-1:111122223333:cluster-snapshot:sample-cluster-snapshot"
    }
}
```

**Example**  
**範例 2：跨 複製未加密的快照 AWS 區域**  
下列 AWS CLI 範例會建立具有 `sample-cluster-snapshot`ARN 的 複本`arn:aws:rds:us-east-1:123456789012:cluster-snapshot:sample-cluster-snapshot`。此副本名為 `sample-cluster-snapshot-copy`，位於執行命令的 AWS 區域 中。  
針對 Linux、macOS 或 Unix：  

```
aws docdb copy-db-cluster-snapshot \
    --source-db-cluster-snapshot-identifier arn:aws:rds:us-east-1:123456789012:cluster-snapshot:sample-cluster-snapshot \
    --target-db-cluster-snapshot-identifier sample-cluster-snapshot-copy
```
針對 Windows：  

```
aws docdb copy-db-cluster-snapshot ^
    --source-db-cluster-snapshot-identifier arn:aws:rds:us-east-1:123456789012:cluster-snapshot:sample-cluster-snapshot ^
    --target-db-cluster-snapshot-identifier sample-cluster-snapshot-copy
```
此操作的輸出將會如下所示。  

```
{
    "DBClusterSnapshot": {
        "AvailabilityZones": [
            "us-east-1a",
            "us-east-1b",
            "us-east-1c"
        ],
        "DBClusterSnapshotIdentifier": "sample-cluster-snapshot-copy",
        "DBClusterIdentifier": "sample-cluster",
        "SnapshotCreateTime": "2020-04-29T16:45:51.239Z",
        "Engine": "docdb",
        "AllocatedStorage": 0,
        "Status": "copying",
        "Port": 0,
        "VpcId": "vpc-abc0123",
        "ClusterCreateTime": "2020-04-28T16:43:00.294Z",
        "MasterUsername": "master-user",
        "EngineVersion": "4.0.0",
        "LicenseModel": "docdb",
        "SnapshotType": "manual",
        "PercentProgress": 0,
        "StorageEncrypted": false,
        "DBClusterSnapshotArn": "arn:aws:rds:us-east-1:123456789012:cluster-snapshot:sample-cluster-snapshot-copy",
        "SourceDBClusterSnapshotArn": "arn:aws:rds:us-east-1:123456789012:cluster-snapshot:sample-cluster-snapshot",
    }
}
```

**Example**  
**範例 3：跨 複製加密快照 AWS 區域**  
下列 AWS CLI 範例會建立`sample-cluster-snapshot`從 us-west-2 區域到 us-east-1 區域的 複本。此命令會在 us-east-1 區域中呼叫。  
針對 Linux、macOS 或 Unix：  

```
aws docdb copy-db-cluster-snapshot \
    --source-db-cluster-snapshot-identifier arn:aws:rds:us-west-2:123456789012:cluster-snapshot:sample-cluster-snapshot \
    --target-db-cluster-snapshot-identifier sample-cluster-snapshot-copy \
    --source-region us-west-2 \
    --kms-key-id sample-us-east-1-key
```
針對 Windows：  

```
aws docdb copy-db-cluster-snapshot ^
    --source-db-cluster-snapshot-identifier arn:aws:rds:us-west-2:123456789012:cluster-snapshot:sample-cluster-snapshot ^
    --target-db-cluster-snapshot-identifier sample-cluster-snapshot-copy ^
    --source-region us-west-2 ^
    --kms-key-id sample-us-east-1-key
```
此操作的輸出將會如下所示。  

```
{
    "DBClusterSnapshot": {  
        "AvailabilityZones": [],
        "DBClusterSnapshotIdentifier": "sample-cluster-snapshot-copy",
        "DBClusterIdentifier": "sample-cluster",
        "SnapshotCreateTime": "2020-04-29T16:45:53.159Z",
        "Engine": "docdb",
        "AllocatedStorage": 0,
        "Status": "copying",
        "Port": 0,
        "ClusterCreateTime": "2020-04-28T16:43:07.129Z",
        "MasterUsername": "chimera",
        "EngineVersion": "4.0.0",
        "LicenseModel": "docdb",
        "SnapshotType": "manual",
        "PercentProgress": 0,
        "StorageEncrypted": true,
        "KmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/0846496a-d48e-41c4-9353-86d8301d7e35",
        "DBClusterSnapshotArn": "arn:aws:rds:us-east-1:123456789012:cluster-snapshot:sample-cluster-snapshot-copy",
        "SourceDBClusterSnapshotArn": "arn:aws:rds:us-west-2:123456789012:cluster-snapshot:sample-cluster-snapshot",
    }
}
```

**Example**  
**範例 4：跨 複製未加密的共用快照 AWS 區域**  
下列 AWS CLI 範例 帳戶 - `123456789012`會建立帳戶`sample-cluster-snapshot`共用的未加密叢集快照複本 - `999999999999` 從 us-east-1 區域到 us-west-2 區域。此命令會在 us-west-2 區域中呼叫。如需有關共用快照的詳細資訊，請參閱 [共用快照](backup_restore-share_cluster_snapshots.md#backup_restore-share_snapshots)。  
針對 Linux、macOS 或 Unix：  

```
aws docdb copy-db-cluster-snapshot \
--region us-west-2 \
--source-db-cluster-snapshot-identifier arn:aws:rds:us-east-1:999999999999:cluster-snapshot:sample-cluster-snapshot \
--target-db-cluster-snapshot-identifier sample-cluster-snapshot-copy
```
針對 Windows：  

```
aws docdb copy-db-cluster-snapshot ^
--region us-west-2 ^
--source-db-cluster-snapshot-identifier arn:aws:rds:us-east-1:999999999999:cluster-snapshot:sample-cluster-snapshot ^
--target-db-cluster-snapshot-identifier sample-cluster-snapshot-copy
```
此操作的輸出將會如下所示。  

```
{
 "DBClusterSnapshots": [
 {
 "AvailabilityZones": [],
 "DBClusterSnapshotIdentifier": "sample-cluster-snapshot-copy",
 "DBClusterIdentifier": "sample-cluster",
 "SnapshotCreateTime": "2025-08-22T11:27:00.497000+00:00",
 "Engine": "docdb",
 "Status": "copying",
 "Port": 0,
 "ClusterCreateTime": "2024-07-02T16:44:50.246000+00:00",
 "MasterUsername": "master-user",
 "EngineVersion": "5.0.0",
 "SnapshotType": "manual",
 "PercentProgress": 0,
 "StorageEncrypted": false,
 "DBClusterSnapshotArn": "arn:aws:rds:us-west-2:123456789012:cluster-snapshot:sample-cluster-snapshot-copy",
 "SourceDBClusterSnapshotArn": "arn:aws:rds:us-east-1:999999999999:cluster-snapshot:sample-cluster-snapshot"
 }
 ]
}
```

**Example**  
**範例 5：將加密的共用快照複製到 AWS 區域**  
下列 AWS CLI 範例，帳戶 - `123456789012`會建立帳戶`sample-cluster-snapshot`共用的加密叢集快照複本 - `999999999999` 從 us-east-1 區域到 us-west-2 區域。目標快照會使用客戶受管 KMS 金鑰 - 加密`arn:aws:kms:us-west-2:123456789012:key/6c1f3264-1797-472b-ba37-03011e682d28`。此命令會在 us-west-2 區域中呼叫。如需有關共用快照的詳細資訊，請參閱 [共用快照](backup_restore-share_cluster_snapshots.md#backup_restore-share_snapshots)。  
針對 Linux、macOS 或 Unix：  

```
aws docdb copy-db-cluster-snapshot \
--region us-west-2 \
--source-db-cluster-snapshot-identifier arn:aws:rds:us-east-1:999999999999:cluster-snapshot:sample-cluster-snapshot \
--target-db-cluster-snapshot-identifier sample-cluster-snapshot-copy \
--kms-key-id arn:aws:kms:us-west-2:123456789012:key/6c1f3264-1797-472b-ba37-03011e682d28
```
針對 Windows：  

```
aws docdb copy-db-cluster-snapshot ^
--region us-west-2 ^
--source-db-cluster-snapshot-identifier arn:aws:rds:us-east-1:999999999999:cluster-snapshot:sample-cluster-snapshot ^
--target-db-cluster-snapshot-identifier sample-cluster-snapshot-copy ^
--kms-key-id arn:aws:kms:us-west-2:123456789012:key/6c1f3264-1797-472b-ba37-03011e682d28
```
此操作的輸出將會如下所示。  

```
{
 "DBClusterSnapshots": [
 {
 "AvailabilityZones": [],
 "DBClusterSnapshotIdentifier": "sample-cluster-snapshot-copy",
 "DBClusterIdentifier": "sample-cluster",
 "SnapshotCreateTime": "2025-08-22T11:27:00.497000+00:00",
 "Engine": "docdb",
 "Status": "copying",
 "Port": 0,
 "ClusterCreateTime": "2024-07-02T16:44:50.246000+00:00",
 "MasterUsername": "master-user",
 "EngineVersion": "5.0.0",
 "SnapshotType": "manual",
 "PercentProgress": 0,
 "StorageEncrypted": true,
 "KmsKeyId": "arn:aws:kms:us-west-2:123456789012:key/6c1f3264-1797-472b-ba37-03011e682d28",
 "DBClusterSnapshotArn": "arn:aws:rds:us-west-2:123456789012:cluster-snapshot:sample-cluster-snapshot-copy",
 "SourceDBClusterSnapshotArn": "arn:aws:rds:us-east-1:999999999999:cluster-snapshot:sample-cluster-snapshot"
 }
 ]
}
```

**注意**  
如需加密快照複本的詳細資訊，請參閱 [複製叢集快照加密](backup_restore-cluster_snapshot_considerations.md#backup_restore-encryption)。  
如需靜態加密的詳細資訊，請參閱 [加密靜態 Amazon DocumentDB 資料](encryption-at-rest.md)。

------