UpCloud

Database Operations

Manage operational tasks for your Managed Databases including migrations, version upgrades, maintenance windows, and cloning.


GET/1.3/database/{uuid}/tasks/{id}

Get task details

Returns details of a specific task for a Managed Database service. Available for MySQL and PostgreSQL.

Request

GET
/1.3/database/{uuid}/tasks/{id}
curl -X GET https://api.upcloud.com/1.3/database/09a4b9d5-c1f8-4c9f-9e7a-1234567890ab/tasks/9b39f10d-e356-437b-b907-d6d5574721b2 \
  -u your_username:your_password

POST/1.3/database/{uuid}/tasks

Create task

Creates a task to check for potential errors before starting a migration or upgrade. Tasks can be synchronous (immediate result) or asynchronous (track via Get task details).

Migration check

  • Name
    operation
    Type
    string
    Description

    Set to "migration_check". Required.

  • Name
    migration_check
    Type
    object
    Description

    Migration configuration. Required.

  • Name
    source_service_uri
    Type
    string
    Description

    Database connection string. Required.

  • Name
    method
    Type
    string
    Description

    Migration method: "dump" or "replication".

  • Name
    ignore_dbs
    Type
    string
    Description

    Comma-separated list of databases to ignore. MySQL only.

Upgrade check (PostgreSQL)

  • Name
    operation
    Type
    string
    Description

    Set to "upgrade_check". Required.

  • Name
    target_version
    Type
    string
    Description

    Target major version number. Required.

Request

POST
/1.3/database/{uuid}/tasks
curl -X POST https://api.upcloud.com/1.3/database/09a4b9d5-c1f8-4c9f-9e7a-1234567890ab/tasks \
  -u your_username:your_password \
  -H "Content-Type: application/json" \
  -d '{
    "operation": "migration_check",
    "migration_check": {
      "source_service_uri": "postgresql://user:pass@host:5432/dbname",
      "method": "replication"
    }
  }'

GET/1.3/database/{uuid}/migration-status

Get migration status

Returns the migration progress for a Managed Database service. Available for MySQL and PostgreSQL.

Request

GET
/1.3/database/{uuid}/migration-status
curl -X GET https://api.upcloud.com/1.3/database/09a4b9d5-c1f8-4c9f-9e7a-1234567890ab/migration-status \
  -u your_username:your_password

POST/1.3/database/{uuid}/migration

Create migration

Starts a migration from an external database to the Managed Database service.

Attributes

  • Name
    source_service_uri
    Type
    string
    Description

    Source database connection string. Required.

  • Name
    method
    Type
    string
    Description

    Migration method: "dump" or "replication".

  • Name
    ignore_dbs
    Type
    string
    Description

    Comma-separated list of databases to ignore. MySQL only.

  • Name
    ssl
    Type
    boolean
    Description

    Enable SSL for connection. Default: true.

Request

POST
/1.3/database/{uuid}/migration
curl -X POST https://api.upcloud.com/1.3/database/09a4b9d5-c1f8-4c9f-9e7a-1234567890ab/migration \
  -u your_username:your_password \
  -H "Content-Type: application/json" \
  -d '{
    "source_service_uri": "mysql://user:pass@external-host:3306/dbname",
    "method": "replication",
    "ssl": true
  }'

POST/1.3/database/{uuid}/upgrade

Upgrade database

Upgrades a PostgreSQL Managed Database to a newer major version. Run an upgrade check task first to verify compatibility.

Attributes

  • Name
    target_version
    Type
    string
    Description

    Target major version number. Required.

Request

POST
/1.3/database/{uuid}/upgrade
curl -X POST https://api.upcloud.com/1.3/database/09a4b9d5-c1f8-4c9f-9e7a-1234567890ab/upgrade \
  -u your_username:your_password \
  -H "Content-Type: application/json" \
  -d '{
    "target_version": "16"
  }'

POST/1.3/database/{uuid}/maintenance

Start maintenance

Manually triggers maintenance updates for a Managed Database service, if updates are available.

Request

POST
/1.3/database/{uuid}/maintenance
curl -X POST https://api.upcloud.com/1.3/database/09a4b9d5-c1f8-4c9f-9e7a-1234567890ab/maintenance \
  -u your_username:your_password

POST/1.3/database/{uuid}/clone

Clone database

Creates a clone of an existing Managed Database service. The clone can be created from the current state or from a point-in-time backup.

Attributes

  • Name
    name
    Type
    string
    Description

    Name for the cloned database. Required.

  • Name
    title
    Type
    string
    Description

    Human-readable title.

  • Name
    zone
    Type
    string
    Description

    Zone for the clone. Default: same as source.

  • Name
    plan
    Type
    string
    Description

    Service plan. Default: same as source.

  • Name
    recovery_time
    Type
    string
    Description

    Point-in-time to restore from (ISO 8601 format).

Request

POST
/1.3/database/{uuid}/clone
curl -X POST https://api.upcloud.com/1.3/database/09a4b9d5-c1f8-4c9f-9e7a-1234567890ab/clone \
  -u your_username:your_password \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my-mysql-db-clone",
    "title": "MySQL Database Clone",
    "zone": "fi-hel1"
  }'