How can I migrate from provisioned Aurora to Aurora Serverless, or from Aurora Serverless to provisioned Aurora?

4 minute read
0

I want to migrate between a provisioned Amazon Aurora DB instance and an Aurora Serverless DB instance.

Short description

To migrate from provisioned to serverless instances or from serverless to provisioned instances, use of one the following methods:

  • Snapshot restore
  • Logical backup and restore
  • A new serverless reader (for Amazon Aurora PostgreSQL-Compatible Edition versions 13.6 and later)

Resolution

Snapshot restore

1.    Open the Amazon Relational Database Service (Amazon RDS) console, and then from the navigation pane, choose Databases.

2.    Select the Aurora cluster that you want to migrate to provisioned or serverless, and then choose Actions.

3.    Choose Take snapshot. For more information, see Creating a DB cluster snapshot.

4.    Navigate to the Snapshots section of the Amazon RDS console.

5.    Choose Actions, and then choose Restore snapshot. For more information, see Restoring from a DB cluster snapshot.

6.    Choose Provisioned or Serverless based on what you want to do.
Note: Aurora Serverless is available only on specific engine versions. For more information see, Aurora Serverless v1 and Aurora Serverless v2.

7.    For Aurora Serverless v1: In the DB instance settings under Capacity type, choose Serverless. For Serverless v2: In the Instance configuration section under DB instance class, choose Serverless.

8.    For the DB cluster identifier, enter a name for your restored cluster.

9.    Specify any other settings. For more information, see Settings for Aurora DB clusters.

10.    Choose Restore DB Cluster.

Logical backup and restore

Create a new DB cluster

1.    Open the Amazon RDS console, and then from the navigation pane, choose Databases.

2.    Choose Create database.
Note: Aurora isn't available in all AWS Regions. For a list of Regions where Aurora is available, see Region availability.

3.    In Engine options, choose Amazon Aurora.

4.    In Edition, select one of the following:
Amazon Aurora with MySQL compatibility
-or-
Amazon Aurora with PostgreSQL compatibility

5.    Select your Engine version.
Note: Aurora Serverless is available only on specific engine versions. For more information see, Aurora Serverless v1 and Aurora Serverless v2.

6.    Specify any other settings. For more information, see Creating a DB cluster.

7.    Choose Create database.

Create a logical backup and restore

1.    Connect to the source DB cluster. If you use PostgreSQL, then run a pg_dump (on the PostgreSQL website). If you use MySQL, then run a mysqldump (on the MySQL website).

2.    Connect to the new DB cluster. If you use PostgreSQL, then restore the dump with pg_restore (on the PostgreSQL website). If you use MySQL, then restore the dump with the mysql command (on the AWS in Plain English website).

Create a new serverless reader on the cluster (Aurora Postgresql versions 13.6 and later)

The following steps apply to Aurora PostgreSQL-Compatible versions 13.6 and later and Aurora MySQL-Compatible versions 8.0.mysql_aurora.3.02.2 and later.

Important: Of the minor versions, only Aurora Serverless version 2 supports the creation and addition of a serverless reader instance to Aurora MySQL and Aurora PostgreSQL. Before you add the instance through the API, modify the DB cluster to support serverless-v2-scaling-configuration.

1.    Open the Amazon RDS console.

2.    Add a serverless reader. Be sure to choose Serverless as the instance configuration.
Note: For more information on adding replicas, see Adding Aurora Replicas to a DB cluster.

3.    When the serverless instance is available as a reader, force a failover. This promotes the reader instance to a writer instance.

How to avoid data loss

To avoid data loss between the two clusters, stop all write activity on the source cluster when the newly created or restored cluster completes its workflow. Stop all write activity before you create the snapshot, mysqldump, or pg_dump.

When the new Aurora cluster is available, direct your application or write operations to the cluster so that you don't lose any write operations.

For example, you have a cluster that's named example-cluster. Rename the old cluster to example-cluster-old. Then, rename the new cluster to example-cluster. This allows your applications to connect to the new cluster with the same cluster endpoint. For example, use example-cluster.cluster-...rds.amazonaws.com for the writer and example-cluster.cluster-ro-...rds.amazonaws.com for the reader endpoint.

AWS OFFICIAL
AWS OFFICIALUpdated 10 months ago
1 Comment

This is outdated.

You can, from supported DB Engine versions, add Serverless instances to an existing cluster OR convert provisioned instances into Serverless without disruptions.

replied 10 months ago