---
title: "Start an Online Migration"
method: PUT
path: "/v2/databases/{database_cluster_uuid}/online-migration"
tags: ["DigitalOcean-public.v2-new_Databases"]
---

# Start an Online Migration

`PUT /v2/databases/{database_cluster_uuid}/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](https://docs.digitalocean.com/products/databases/mysql/how-to/migrate/#:~:text=To%20migrate%20a%20MySQL%20database,then%20select%20Set%20Up%20Migration),  [PostgreSQL](https://docs.digitalocean.com/products/databases/postgresql/how-to/migrate/),  [Caching](https://docs.digitalocean.com/products/databases/redis/how-to/migrate/), and [Valkey](https://docs.digitalocean.com/products/databases/valkey/how-to/migrate/) clusters.

## Path parameters

- `database_cluster_uuid` string, uuid, required

## Request body

- SourceDatabase
  - `source` object, required
    - `host` string — The FQDN pointing to the database cluster's current primary node.
    - `port` integer — The port on which the database cluster is listening.
    - `dbname` string — The name of the default database.
    - `username` string — The default user for the database.
    - `password` string — The randomly generated password for the default user.
  - `disable_ssl` boolean — Enables SSL encryption when connecting to the source database.
  - `ignore_dbs` string[] — List of databases that should be ignored during migration.

## Response `200`

A JSON object.

- OnlineMigration
  - `id` string — The ID of the most recent migration.
  - `status` 'running' | 'syncing' | 'canceled' | 'error' | 'done' — The current status of the migration.
  - `created_at` string — The time the migration was initiated, in ISO 8601 format.

## Other responses

- `401` — Authentication failed due to invalid credentials.
- `404` — The resource was not found.
- `429` — The API rate limit has been exceeded.
- `500` — There was a server error.
- `default` — There was an unexpected error.

---

[API](https://skmtc.net/digitalocean/apis/digitalocean-api.md) · [All operations](https://skmtc.net/digitalocean/apis/digitalocean-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/digitalocean/digitalocean-api/versions/cb3bf9b21459/schema)
