Validated on 2 Feb 2022 • Last edited on 18 Dec 2024
MySQL is an open source, object-relational database built with speed and reliability in mind. Its large and active developer community has created many third-party applications, tools, and libraries that expand MySQL’s functionality.
Relocating a database cluster changes which DigitalOcean datacenter hosts it. We recommend hosting your DigitalOcean resources in the same datacenter. This minimizes the latency in connections between them and helps improve performance.
Relocate a Database Cluster Using the CLI
Note
To migrate a database cluster using doctl, you need to provide a value for the --region flag. Use the doctl databases options regions command to get a list of available values.
How to Migrate a Database Using the DigitalOcean CLI
import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
req = {
"region": "lon1"
}
update_resp = client.databases.update_region(database_cluster_uuid="a7a8bas", body=req)
Relocate a Database Cluster using the Control Panel
To relocate a database cluster from the control panel, select your database cluster from the Databases page. Click the name of the cluster to go to its Overview page, then click the Settings tab.
On the Settings page, in the Cluster datacenter section, click Edit. Select the region and datacenter to which you want to relocate your cluster.
Click Save to begin the relocation process. The time to complete the relocation varies depending on the size of the cluster and its data.