

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

# 還原 Neptune 叢集
<a name="restoring-nep"></a>

## 使用 AWS Backup 主控台還原 Amazon Neptune 復原點
<a name="nep-restore-console"></a>

還原 Amazon Neptune 資料庫需要您指定多個還原選項。如需這些選項的資訊，請參閱《Neptune 使用者指南》**中的《[從資料庫叢集快照還原](https://docs.aws.amazon.com/neptune/latest/userguide/backup-restore-restore-snapshot.html)》。

**還原 Neptune 資料庫**

1. 在 https：//[https://console.aws.amazon.com/backup](https://console.aws.amazon.com/backup) 開啟 AWS Backup 主控台。

1. 在導覽窗格中，選擇 **受保護的資源** 和您要還原的 Neptune 資源 ID。

1. **Resource details (資源詳細資訊)** 頁面上會顯示所選資源 ID 的復原點清單。若要還原資源，請在 **Backups (備份)** 窗格中，選擇資源復原點 ID 旁邊的選項按鈕。在窗格右上角，選擇 **Restore (還原)**。

1. 在 **執行個體規格** 窗格中，接受預設值，或指定 **資料庫引擎** 和 **版本**。

1. 在**設定**窗格中，為 AWS 帳戶 目前區域中 擁有的所有資料庫叢集執行個體指定唯一的名稱。資料庫叢集識別符會區分大小寫，但全部以小寫形式儲存，如「`mydbclusterinstance`」中所示。此為必要欄位。

1. 在 **資料庫選項** 窗格中，接受預設值，或指定 **資料庫連接埠** 和 **資料庫叢集參數群組** 的選項。

1. 在 **Encryption (加密)** 窗格中，接受預設值，或指定 **Enable encryption (啟用加密)** 或 **Disable encryption (停用加密)** 設定的選項。

1. 在 **Log exports (日誌匯出)** 窗格中，選擇要發佈到 Amazon CloudWatch Logs 的日誌類型。**IAM role (IAM 角色)** 已定義。

1. 在 **Restore role (還原角色)** 窗格中，選擇 AWS Backup 在此次還原中具有的 IAM 角色。

1. 指定所有設定之後，請選擇 **Restore backup (還原備份)**。

   **Restore jobs (還原任務)** 窗格隨即出現。頁面頂端的訊息提供還原任務的相關資訊。

1. 還原完成之後，請將還原的 Neptune 叢集連接至 Amazon RDS 執行個體。

## 使用 AWS Backup API、CLI 或 SDK 還原 Neptune 復原點
<a name="nep-restore-cli"></a>

請先還原叢集。請使用 `[StartRestoreJob](https://docs.aws.amazon.com/aws-backup/latest/devguide/API_StartRestoreJob.html)`。您可以在 Amazon DocumentDB 還原期間指定下列中繼資料：

```
availabilityZones
backtrackWindow
copyTagsToSnapshot // Boolean 
databaseName // string 
dbClusterIdentifier // string 
dbClusterParameterGroupName // string 
dbSubnetGroupName // string 
enableCloudwatchLogsExports // string 
enableIAMDatabaseAuthentication // Boolean 
engine // string 
engineMode // string 
engineVersion // string 
kmsKeyId // string 
port // integer 
optionGroupName // string 
scalingConfiguration
vpcSecurityGroupIds // string
```

然後，使用 將還原的 Neptune 叢集連接到 Amazon RDS 執行個體`create-db-instance`。
+ 針對 Linux、macOS 或 Unix：

  ```
  aws neptune create-db-instance --db-instance-identifier sample-instance \ 
                    --db-instance-class db.r5.large --engine neptune --engine-version 1.0.5.0 --db-cluster-identifier sample-cluster --region us-east-1
  ```
+ 針對 Windows：

  ```
  aws neptune create-db-instance --db-instance-identifier sample-instance ^
                    --db-instance-class db.r5.large --engine neptune --engine-version 1.0.5.0 --db-cluster-identifier sample-cluster --region us-east-1
  ```

如需詳細資訊，請參閱《Neptune 管理 API 參考》**中的 [https://docs.aws.amazon.com/neptune/latest/userguide/api-snapshots.html#RestoreDBClusterFromSnapshot](https://docs.aws.amazon.com/neptune/latest/userguide/api-snapshots.html#RestoreDBClusterFromSnapshot) 和《Neptune CLI 指南》**中的 [https://awscli.amazonaws.com/v2/documentation/api/latest/reference/neptune/restore-db-cluster-from-snapshot.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/neptune/restore-db-cluster-from-snapshot.html)。