Restoring a DB cluster to a specified time - Amazon Aurora

Restoring a DB cluster to a specified time

You can restore a DB cluster to a specific point in time, creating a new DB cluster.

When you restore a DB cluster to a point in time, you can choose the default VPC security group or apply a custom VPC security group to your DB cluster.

Restored DB clusters are automatically associated with the default DB cluster and DB parameter groups. However, you can apply custom parameter groups by specifying them during a restore.

RDS uploads transaction logs for DB clusters to Amazon S3 continuously. To see the latest restorable time for a DB cluster, use the AWS CLI describe-db-clusters command and look at the value returned in the LatestRestorableTime field for the DB cluster.

You can restore to any point in time within your backup retention period. To see the earliest restorable time for a DB cluster, use the AWS CLI describe-db-clusters command and look at the value returned in the EarliestRestorableTime field for the DB cluster.

Note

For more information about backing up and restoring an Aurora DB cluster, see Overview of backing up and restoring an Aurora DB cluster. For Aurora MySQL, you can restore a provisioned DB cluster to an Aurora Serverless DB cluster. For more information, see Restoring an Aurora Serverless v1 DB cluster.

You can restore a DB cluster to a point in time using the AWS Management Console, the AWS CLI, or the RDS API.

To restore a DB cluster to a specified time

  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 Databases.

  3. Choose the DB cluster that you want to restore.

  4. For Actions, choose Restore to point in time.

    The Restore to point in time window appears.

  5. Choose Latest restorable time to restore to the latest possible time, or choose Custom to choose a time.

    If you chose Custom, enter the date and time to which you want to restore the cluster.

    Note

    Times are shown in your local time zone, which is indicated by an offset from Coordinated Universal Time (UTC). For example, UTC-5 is Eastern Standard Time/Central Daylight Time.

  6. For DB instance identifier, enter the name of the target restored DB cluster. The name must be unique.

  7. Choose other options as needed, such as DB instance class and storage.

  8. Choose Restore to point in time.

To restore a DB cluster to a specified time, use the AWS CLI command restore-db-cluster-to-point-in-time to create a new DB cluster.

For Linux, macOS, or Unix:

aws rds restore-db-cluster-to-point-in-time \ --source-db-cluster-identifier mysourcedbcluster \ --db-cluster-identifier mytargetdbcluster \ --restore-to-time 2017-10-14T23:45:00.000Z

For Windows:

aws rds restore-db-cluster-to-point-in-time ^ --source-db-cluster-identifier mysourcedbcluster ^ --db-cluster-identifier mytargetdbcluster ^ --restore-to-time 2017-10-14T23:45:00.000Z
Important

If you use the console to restore a DB cluster to a specified time, then Amazon RDS automatically creates the primary instance (writer) for your DB cluster. If you use the AWS CLI to restore a DB cluster to a specified time, you must explicitly create the primary instance for your DB cluster. The primary instance is the first instance that is created in a DB cluster. Call the create-db-instance AWS CLI command to create the primary instance for your DB cluster. Include the name of the DB cluster as the --db-cluster-identifier option value.

To restore a DB cluster to a specified time, call the Amazon RDS API RestoreDBClusterToPointInTime operation with the following parameters:

  • SourceDBClusterIdentifier

  • DBClusterIdentifier

  • RestoreToTime

Important

If you use the console to restore a DB cluster to a specified time, then Amazon RDS automatically creates the primary instance (writer) for your DB cluster. If you use the RDS API to restore a DB cluster to a specified time, you must explicitly create the primary instance for your DB cluster. The primary instance is the first instance that is created in a DB cluster. Call the RDS API operation CreateDBInstance to create the primary instance for your DB cluster. Include the name of the DB cluster as the DBClusterIdentifier parameter value.