Restoring from a DB cluster snapshot
Amazon RDS creates a storage volume snapshot of your DB cluster, backing up the entire DB instance and not just individual databases. You can create a DB cluster by restoring from this DB cluster snapshot. When you restore the DB cluster, you provide the name of the DB cluster snapshot to restore from, and then provide a name for the new DB cluster that is created from the restore. You can't restore from a DB cluster snapshot to an existing DB cluster; a new DB cluster is created when you restore.
Sharing a manual DB cluster snapshot, whether encrypted or unencrypted, enables authorized AWS accounts to directly restore a DB cluster from the snapshot instead of taking a copy of it and restoring from that. For more information, see Sharing a DB cluster snapshot.
Parameter group considerations
We recommend that you retain the parameter group for any DB cluster snapshots you create, so that you can associate your restored DB cluster with the correct parameter group. You can specify the parameter group when you restore the DB cluster.
Security group considerations
When you restore a DB cluster, the default security group is associated with the restored cluster by default.
-
If you're using the Amazon RDS console, you can specify a custom security group to associate with the cluster or create a new VPC security group.
-
If you're using the AWS CLI, you can specify a custom security group to associate with the cluster by including the
--vpc-security-group-ids
option in therestore-db-cluster-from-snapshot
command. -
If you're using the Amazon RDS API, you can include the
VpcSecurityGroupIds.VpcSecurityGroupId.N
parameter in theRestoreDBClusterFromSnapshot
action.
As soon as the restore is complete and your new DB cluster is available, you can associate any custom security
groups used by the snapshot you restored from. You must
apply these changes by modifying the DB cluster with the RDS console,
the AWS CLI
modify-db-cluster
command, or the
ModifyDBCluster
Amazon RDS API operation. For more information, see Modifying an Amazon Aurora DB cluster.
Amazon Aurora considerations
With Aurora, you restore a DB cluster snapshot to a DB cluster.
With Aurora MySQL, you can also restore a DB cluster snapshot to an Aurora Serverless DB cluster. For more information, see Restoring an Aurora Serverless v1 DB cluster.
With Aurora MySQL, you can restore a DB cluster snapshot from a cluster without parallel query to a cluster with parallel query. Because parallel query is typically used with very large tables, the snapshot mechanism is the fastest way to ingest large volumes of data to an Aurora MySQL parallel query-enabled cluster. For more information, see Working with parallel query for Amazon Aurora MySQL.
Restoring from a snapshot
You can restore a DB cluster from a DB cluster snapshot using the AWS Management Console, the AWS CLI, or the RDS API.
To restore a DB cluster from a DB cluster snapshot
-
Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/
. -
In the navigation pane, choose Snapshots.
-
Choose the DB cluster snapshot that you want to restore from.
-
For Actions, choose Restore snapshot.
-
On the Restore snapshot page, for DB instance identifier, enter the name for your restored DB cluster.
-
Choose Restore DB instance.
To restore a DB cluster from a DB cluster snapshot, use the AWS CLI command restore-db-cluster-from-snapshot.
In this example, you restore from a previously created DB cluster snapshot named
mydbclustersnapshot
. You restore to a new DB cluster named mynewdbcluster
.
Example
For Linux, macOS, or Unix:
aws rds restore-db-cluster-from-snapshot \ --db-cluster-identifier
mynewdbcluster
\ --snapshot-identifiermydbclustersnapshot
\ --engineaurora|aurora-mysql|aurora-postgresql
For Windows:
aws rds restore-db-cluster-from-snapshot ^ --db-cluster-identifier
mynewdbcluster
^ --snapshot-identifiermydbclustersnapshot
^ --engineaurora|aurora-mysql|aurora-postgresql
After the DB cluster has been restored, you must add the DB cluster to the security group used by the DB cluster used to create the DB cluster snapshot if you want the same functionality as that of the previous DB cluster.
If you use the console to restore a DB cluster, then Amazon RDS automatically
creates the primary instance (writer) for your DB cluster. If you use the AWS
CLI
to restore a DB cluster, 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 from a DB cluster snapshot, call the RDS API operation RestoreDBClusterFromSnapshot with the following parameters:
-
DBClusterIdentifier
-
SnapshotIdentifier
If you use the console to restore a DB cluster, then Amazon RDS automatically
creates the primary instance (writer) for your DB cluster. If you use the RDS
API
to restore a DB cluster, 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.