NavigationContentFooter
Suggest an edit

Migrating Database Instance endpoints via the Scaleway CLI

Reviewed on 22 November 2023Published on 22 November 2023

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.

Security & Identity (IAM)

To perform certain actions described below, you must either be the Owner of the Organization in which the actions will be performed or an IAM user with the necessary permissions.

Requirements
  • You have an account and are logged into the Scaleway console
  • You have a PostgreSQL or MySQL Database Instance
  • You have installed and set up the Scaleway Command Line Interface (CLI)
  • You have a jq library installed on your local machine
  1. 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.

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

    Important

    Before migrating the endpoint, keep in mind that:

    • If you want to migrate a load_balancer endpoint type the target Database Instance must not have a load_balancer endpoint
    • If you want to migrate a private_network endpoint type the target Database Instance must not have a private_network endpoint

    You can use the CLI to remove the already existing endpoints on the target Database Instance.

    endpoint=$(scw rdb instance get $DB_INSTANCE_ID -o json | jq -r ".endpoints[] | select( .load_balancer != null ) | .id")
    Tip

    To retrieve a Private Network endpoint, run:

    endpoint=$(scw rdb instance get $DB_INSTANCE_ID -o json | jq -r ".endpoints[] | select( .private_network != null ) | .id")

    Make sure you replace $DB_INSTANCE_ID with the UUID of the original Database Instance.

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

Cloud Products & Resources
  • Scaleway Console
  • Compute
  • Storage
  • Network
  • IoT
  • AI
Dedicated Products & Resources
  • Dedibox Console
  • Dedibox Servers
  • Network
  • Web Hosting
Scaleway
  • Scaleway.com
  • Blog
  • Careers
  • Scaleway Learning
Follow us
FacebookTwitterSlackInstagramLinkedin
ContractsLegal NoticePrivacy PolicyCookie PolicyDocumentation license
© 1999-2024 – Scaleway SAS