Migrating Database Instance endpoints via the Scaleway CLI
You can migrate your endpoints from a Database Instance to another anytime, using the Scaleway CLI.
The following commands are useful when you upgrade the version of your database engine via the Upgrade only option. In this case, you must manually migrate your endpoint.
Before you start
To complete the actions presented below, you must have:
- A Scaleway account logged into the console
- Owner status or IAM permissions allowing you to perform actions in the intended Organization
- A PostgreSQL or MySQL Database Instance
- Installed and set up the Scaleway Command Line Interface (CLI)
- A
jq
library installed on your local machine
-
Retrieve a list of your Database Instances.
scw rdb instance list
You should get a response like the following:
ID NAME NODE TYPE 70ca91f9-d649-4485-9107-e73c1ecf1eab rdb-calm-outland db-play2-pico 0317a95d-924e-40c0-b6a3-ed579ef3e157 rdb-calm-inland db-play2-pico
Make a record of the unique identifier (UUID) of the Database Instance you wish to migrate from, as well as the UUID of the target Database Instance you intend to migrate to.
-
Run the following command to retrieve the public endpoint of your Database Instance. Make sure you replace
$DB_INSTANCE_ID
with the UUID of the original Database Instance.endpoint=$(scw rdb instance get $DB_INSTANCE_ID -o json | jq -r ".endpoints[] | select( .load_balancer != null ) | .id")
-
Run the following command to migrate the endpoint.
scw rdb endpoint migrate endpoint-id=$endpoint instance-id=$NEW_INSTANCE_ID
Replace
$NEW_INSTANCE_ID
with the UUID of the Database Instance you want to migrate the endpoint to.If the operation was successful, you should see an output like the following:
ID 066b2260-affc-40f4-9794-ce8db20aad16 IP 198.51.100.0 Port 19377
You see the UUID of the endpoint, and the IP and port that make up the endpoint.
You can change your endpoints back to the original Database Instance anytime using the same procedure.