To start an online migration, send a PUT request to /v2/databases/$DATABASE_ID/online-migration
endpoint. Migrating a cluster establishes a connection with an existing cluster and replicates its contents to the target cluster. Online migration is only available for MySQL, PostgreSQL, and Redis clusters.
Name | Type | Required | Description | Default Value |
---|---|---|---|---|
database_cluster_uuid |
string | True | A unique identifier for a database cluster. | |
body |
JSON or IO[bytes] | True |
import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
req = {
"source": {
"host": "source-do-user-6607903-0.b.db.ondigitalocean.com",
"dbname": "defaultdb",
"port": 25060,
"username": "doadmin",
"password": "paakjnfe10rsrsmf"
},
"disable_ssl": False
"ignore_dbs": ["db0","db1"]
}
update_resp = client.databases.update_online_migration(database_cluster_uuid="a7a8bas", body=req)
See the API spec for this endpoint to view additional detail on responses, headers, parameters, and more.