Skip to main content

online_migrations

Creates, updates, deletes, gets or lists an online_migrations resource.

Overview

Nameonline_migrations
TypeResource
Iddigitalocean.databases.online_migrations

Fields

The following fields are returned by SELECT queries:

A JSON object.

NameDatatypeDescription
idstringThe ID of the most recent migration. (example: 77b28fc8-19ff-11eb-8c9c-c68e24557488)
created_atstringThe time the migration was initiated, in ISO 8601 format. (example: 2020-10-29T15:57:38Z)
statusstringThe current status of the migration. (example: running)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
databases_get_migration_statusselectdatabase_cluster_uuidTo retrieve the status of the most recent online migration, send a GET request to /v2/databases/$DATABASE_ID/online-migration.
databases_update_online_migrationexecdatabase_cluster_uuid, sourceTo 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, Caching, and Valkey clusters.
If the existing database is continuously being written to, the migration process will continue for up to two weeks unless it is manually stopped. Online migration is only available for MySQL, PostgreSQL, Caching, and Valkey clusters.
databases_delete_online_migrationexecdatabase_cluster_uuid, migration_idTo stop an online migration, send a DELETE request to /v2/databases/$DATABASE_ID/online-migration/$MIGRATION_ID.

A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
database_cluster_uuidstring (uuid)A unique identifier for a database cluster. (example: 9cc10173-e9ea-4176-9dbc-a4cee4c4ff30)
migration_idstringA unique identifier assigned to the online migration. (example: 77b28fc8-19ff-11eb-8c9c-c68e24557488)

SELECT examples

To retrieve the status of the most recent online migration, send a GET request to /v2/databases/$DATABASE_ID/online-migration.

SELECT
id,
created_at,
status
FROM digitalocean.databases.online_migrations
WHERE database_cluster_uuid = '{{ database_cluster_uuid }}' -- required;

Lifecycle Methods

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, Caching, and Valkey clusters.
If the existing database is continuously being written to, the migration process will continue for up to two weeks unless it is manually stopped. Online migration is only available for MySQL, PostgreSQL, Caching, and Valkey clusters.

EXEC digitalocean.databases.online_migrations.databases_update_online_migration 
@database_cluster_uuid='{{ database_cluster_uuid }}' --required
@@json=
'{
"source": "{{ source }}",
"disable_ssl": {{ disable_ssl }},
"ignore_dbs": "{{ ignore_dbs }}"
}';