Duplicate database

Clone an existing database to a new database.


POST/api/servers/{server}/databases/{database}/duplicate

Duplicate a database

This endpoint allows you to duplicate an existing database to a new database on the same server.

Required attributes

  • Name
    name
    Type
    string
    Description

    The name for the new database. Max: 255 characters.

Optional attributes

  • Name
    user
    Type
    string
    Description

    Username for the new database. Max: 255 characters.

  • Name
    password
    Type
    string
    Description

    Password for the new database user. Max: 50 characters.

Request

POST
/api/servers/{server}/databases/{database}/duplicate
curl -X POST "https://ploi.io/api/servers/{server}/databases/{database}/duplicate" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "name": "new_database",
    "user": "new_user",
    "password": "random_password"
  }'

Response

{
  "data": {
    "id": 1,
    "type": null,
    "name": "new_database",
    "server_id": 1,
    "status": "created",
    "created_at": "2021-01-01 00:00:00"
  },
  "message": "Database my_database is being cloned to new_database"
}