online_migrations
Creates, updates, deletes, gets or lists an online_migrations
resource.
Overview
Name | online_migrations |
Type | Resource |
Id | digitalocean.databases.online_migrations |
Fields
The following fields are returned by SELECT
queries:
- databases_get_migration_status
A JSON object.
Name | Datatype | Description |
---|---|---|
id | string | The ID of the most recent migration. (example: 77b28fc8-19ff-11eb-8c9c-c68e24557488) |
created_at | string | The time the migration was initiated, in ISO 8601 format. (example: 2020-10-29T15:57:38Z) |
status | string | The current status of the migration. (example: running) |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
databases_get_migration_status | select | database_cluster_uuid | To retrieve the status of the most recent online migration, send a GET request to /v2/databases/$DATABASE_ID/online-migration . | |
databases_update_online_migration | exec | database_cluster_uuid , source | 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. | |
databases_delete_online_migration | exec | database_cluster_uuid , migration_id | To 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.
Name | Datatype | Description |
---|---|---|
database_cluster_uuid | string (uuid) | A unique identifier for a database cluster. (example: 9cc10173-e9ea-4176-9dbc-a4cee4c4ff30) |
migration_id | string | A unique identifier assigned to the online migration. (example: 77b28fc8-19ff-11eb-8c9c-c68e24557488) |
SELECT
examples
- databases_get_migration_status
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
- databases_update_online_migration
- databases_delete_online_migration
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 }}"
}';
To 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.
EXEC digitalocean.databases.online_migrations.databases_delete_online_migration
@database_cluster_uuid='{{ database_cluster_uuid }}' --required,
@migration_id='{{ migration_id }}' --required;