Restoring a DocumentDB cluster - AWS Backup

Restoring a DocumentDB cluster

Use the AWS Backup console to restore Amazon DocumentDB recovery points

Restoring a Amazon DocumentDB cluster requires that you specify multiple restore options. For information about these options, see Restoring from a Cluster Snapshot in the Amazon DocumentDB Developer Guide.

To restore a Amazon DocumentDB cluster
  1. Open the AWS Backup console at https://console.aws.amazon.com/backup.

  2. In the navigation pane, choose Protected resources and the Amazon DocumentDB resource ID that you want to restore.

  3. On the Resource details page, a list of recovery points for the selected resource ID is shown. To restore a resource, in the Backups pane, choose the radio button next to the recovery point ID of the resource. In the upper-right corner of the pane, choose Restore.

  4. In the Configuration pane, accept the defaults or specify the options for the Cluster identifier, Engine version, Instance class, and Number of instances.

    • NOTE: If the default VPC does not exist when restoring, you must specify a subnet in another VPC.

  5. In the Network & Security pane, "No Preferences" will be displayed.

  6. In the Encryption-at-rest pane, accept the default or specify the options for the Enable encryption or Disable encryption settings.

  7. In the Cluster options pane, type in the Port and choose the Cluster parameter group.

  8. In the Backup pane, choose continuous backup for point-in-time recovery (PITR), scheduled snapshot backups, or both.

  9. In the Log exports pane, choose the log types to publish to Amazon CloudWatch Logs. The IAM role is already defined.

  10. In the Maintenance pane, specify a maintenance window or choose No preference.

  11. In the Tags pane, you can choose Add tag.

  12. In the Deletion protection pane, you can choose Enable deletion protection.

  13. After specifying all your settings, choose Restore backup.

    The Restore jobs pane appears. A message at the top of the page provides information about the restore job.

  14. After your restore finishes, attach your restored Amazon DocumentDB cluster to an Amazon RDS instance.

Use the AWS Backup API, CLI, or SDK to restore Amazon DocumentDB recovery points

First, restore your cluster. Use StartRestoreJob. You can specify the following metadata during Amazon DocumentDB restores:

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 pcSecurityGroupIds // string

Then, attached your restored Amazon DocumentDB cluster to an Amazon RDS instance using create-db-instance.

  • For Linux, macOS, or Unix:

    aws docdb create-db-instance --db-instance-identifier sample-instance / --db-cluster-identifier sample-cluster --engine docdb --db-instance-class db.r5.large
  • For Windows:

    aws docdb create-db-instance --db-instance-identifier sample-instance ^ --db-cluster-identifier sample-cluster --engine docdb --db-instance-class db.r5.large