API Reference

Migrations

API reference for moving websites, databases and email to one of your servers from a cPanel full account backup.

Last updated

A migration moves a cPanel account to one of your servers from its full account backup (backup-….tar.gz or cpmove-user.tar.gz). The backup is uploaded to the panel in pieces, then read on the chosen server. From what the server found, you pick what to move; the panel makes the websites, databases and email the usual way, and the server fills them with the files, data and mail. See Moving from cPanel.

Migrations need agent 0.48.0 or newer on the server, and 0.50.0 or newer to move email. They are for staff with websites.manage and databases.manage (and mail.manage to move email); hosting customers are refused with 403 FORBIDDEN.

How a migration works

StepRequestStatus afterwards
1Start a migration and send the backup in pieces.uploading
2Finish the upload. The server reads the backup (MIGRATION_INSPECT).inspecting, then ready
3Read inspection with Get a migration, then move what you pick.creating, then restoring (MIGRATION_RESTORE), then done

Any step can end in failed, with lastError. Discard sets discarded. The backup is deleted from the server once the move is done or discarded.

Endpoints

MethodPathDescription
GET/api/v1/migrationsList migrations
POST/api/v1/migrationsStart a migration
GET/api/v1/migrations/:idGet a migration
PUT/api/v1/migrations/:id/uploads/:uploadId/chunks/:offsetSend a piece of the backup
POST/api/v1/migrations/:id/uploads/:uploadId/finishFinish the upload
POST/api/v1/migrations/:id/startMove what you picked
POST/api/v1/migrations/:id/discardDiscard a migration

The migration object

{
  "id": "5f1e2d3c-4b5a-4968-8776-a5b4c3d2e1f0",
  "serverId": "1f6a3c2e-5b4d-4e7f-9a8b-0c1d2e3f4a5b",
  "serverName": "web-1",
  "fileName": "backup-11.10.2026_09-30-12_shopacct.tar.gz",
  "sizeBytes": 734003200,
  "status": "ready",
  "inspection": {
    "account": "shopacct",
    "mainDomain": "example.com",
    "totalBytes": 734003200,
    "sites": [
      { "domain": "example.com", "aliases": ["www.example.com"], "root": "public_html", "phpVersion": "8.2", "kind": "main", "bytes": 412000000 },
      { "domain": "shop.com", "aliases": ["www.shop.com"], "root": "public_html/shop", "phpVersion": null, "kind": "addon", "bytes": 98000000 }
    ],
    "databases": [{ "name": "shopacct_wp", "bytes": 52428800 }],
    "mail": [
      {
        "domain": "example.com",
        "mailboxes": [{ "local": "info", "address": "info@example.com", "quotaMb": 1024, "bytes": 15728640, "hasMail": true, "hasPassword": true }],
        "forwarders": [{ "local": "sales", "address": "sales@example.com", "destinations": ["team@example.org"] }]
      }
    ]
  },
  "plan": null,
  "result": null,
  "lastJobId": "…",
  "lastError": null,
  "createdAt": "2026-11-11T09:40:00.000Z",
  "updatedAt": "2026-11-11T09:42:10.000Z"
}
FieldDescription
statusuploading, inspecting, ready, creating, restoring, done, failed or discarded.
inspectionWhat the server found in the backup, once ready. Each site's kind is main, addon or subdomain, and its root is its folder in the old home. mail is null when an agent older than 0.50.0 read the backup. Password hashes are never in it.
planWhat was made for the move: sites ({ root, websiteId, name, domains }), databases ({ source, databaseId, userId, name, user }) and mail ({ domains, mailboxes, forwarders, skipped }). Each mailbox has needsPassword when its password could not come over.
resultWhen done: the moved sites, databases, the wordpress sites pointed at their new database, the mail moved per mailbox ({ address, messages, bytes }) and mailErrors.

List migrations

GET/api/v1/migrations
Auth
Session cookie (+ CSRF token) or API token
Permission
websites.manage, databases.manage
Token scope
manage

The 50 newest migrations that were not discarded, newest first.

Example request

curl https://panel.example.com/api/v1/migrations \
  -H "Authorization: Bearer $VAULTPANEL_TOKEN"
const { items } = await panel.request('GET', '/migrations');

Response 200 OK: { items: [migration] }.

Start a migration

POST/api/v1/migrations
Auth
Session cookie (+ CSRF token) or API token
Permission
websites.manage, databases.manage
Token scope
manage

Makes a migration to a server and starts the upload of its backup.

Request body

FieldTypeRequiredDescription
serverIdstring (UUID)YesThe server to move to.
fileNamestringYesThe backup's file name, up to 255 characters.
sizeintegerYesThe backup's size in bytes. At most VAULTPANEL_FILE_UPLOAD_MAX_MB (2048 MB by default).

Example request

curl https://panel.example.com/api/v1/migrations \
  -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" \
  -d '{"serverId":"1f6a3c2e-5b4d-4e7f-9a8b-0c1d2e3f4a5b","fileName":"cpmove-shopacct.tar.gz","size":734003200}'
const { migration, upload } = await panel.request('POST', '/migrations', {
  body: { serverId, fileName: 'cpmove-shopacct.tar.gz', size: file.length },
});

Response 201 Created: { migration, upload }, message Upload the backup. upload is { uploadId, chunkBytes, size }; chunkBytes is the largest piece (8 MB).

Errors

StatusCodeWhen
403FORBIDDENA hosting customer, or a missing permission.
409AGENT_OUTDATEDThe server's agent is older than 0.48.0.
413FILE_TOO_LARGEThe backup is larger than VAULTPANEL_FILE_UPLOAD_MAX_MB.
422VALIDATION_ERRORThe server does not exist, or a field is invalid.

Get a migration

GET/api/v1/migrations/:id
Auth
Session cookie (+ CSRF token) or API token
Permission
websites.manage, databases.manage
Token scope
manage

Response 200 OK: { migration }. Poll it to follow a migration. 404 NOT_FOUND when there is no such migration.

Send a piece of the backup

PUT/api/v1/migrations/:id/uploads/:uploadId/chunks/:offset
Auth
Session cookie (+ CSRF token) or API token
Permission
websites.manage, databases.manage
Token scope
manage

Sends the backup's bytes from offset, as the raw request body (Content-Type: application/octet-stream), up to chunkBytes per request, in order. Only the person who started the upload can add to it.

Example request

curl -X PUT "https://panel.example.com/api/v1/migrations/$MIGRATION_ID/uploads/$UPLOAD_ID/chunks/0" \
  -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/octet-stream" \
  --data-binary @part-0

Response 200 OK: { received, size }. Send the next piece from received.

Errors

StatusCodeWhen
404NOT_FOUNDNo such upload, or it is someone else's.
409OFFSET_MISMATCHThe piece is not for the next offset. details.expected is where to continue.
409UPLOAD_FINISHEDThe upload is already finished.
413CHUNK_TOO_LARGEThe piece is larger than chunkBytes.
422UPLOAD_TOO_LARGEMore data than the size given at the start.

Finish the upload

POST/api/v1/migrations/:id/uploads/:uploadId/finish
Auth
Session cookie (+ CSRF token) or API token
Permission
websites.manage, databases.manage
Token scope
manage

Checks that every byte arrived, computes the backup's SHA-256 and queues MIGRATION_INSPECT. The server fetches the backup, checks it against the SHA-256, keeps it in a folder only root can read and lists what is in it. When the job succeeds, status is ready and inspection is filled in; the panel's copy is deleted.

Response 202 Accepted: { migration, job }, message Reading the backup.

Errors

StatusCodeWhen
409MIGRATION_BUSYThe backup was already uploaded.
409UPLOAD_INCOMPLETENot every byte has arrived. details.received says how many have.

The job fails with MIGRATION_UNSUPPORTED for a file that is not a cPanel full backup, a backup that keeps the home folder as homedir.tar, or one with more than one account; with MIGRATION_ARCHIVE_INVALID for a file tar cannot read; and with MIGRATION_UNREADABLE when the backup's userdata/ does not name the account's domain or website folders.

Move what you picked

POST/api/v1/migrations/:id/start
Auth
Session cookie (+ CSRF token) or API token
Permission
websites.manage, databases.manage
Token scope
manage

Moves the websites, databases and email domains you pick from inspection. Pick at least one.

  • Each website is made as a PHP website with document root public (CREATE_SITE), and the files of its folder are unpacked into it, owned by the website, without setuid bits. Folders of other moved websites inside it are left out.
  • Each database is made with a user of the same name (cut to 32 characters) with full access, and its dump is imported as an account that reaches only it. Databases are linked to the first moved website.
  • A WordPress whose wp-config.php uses a moved database is pointed at the new one.
  • Each email domain is added to the server's mail server (no DNS records are added), with its mailboxes (passwords as cPanel kept them, quotas and all their mail) and forwarders. Addresses the panel already has are left as they are and listed in plan.mail.skipped. Needs a mail server set up on the server, mail.manage and agent 0.50.0 or newer.

When every website and database exists, the panel queues MIGRATION_RESTORE. If making them fails, what was already made is kept and the migration is failed.

Request body

FieldTypeRequiredDescription
sitesobject[]NoUp to 100. Each { root, name, domains, phpVersion }: root from inspection.sites, the website name (3 to 32 lowercase letters, digits and dashes), 1 to 20 domains (no wildcards) and an optional PHP version such as 8.3.
databasesobject[]NoUp to 200. Each { source, name }: source from inspection.databases and the new database's name.
mailobjectNo{ domains }: up to 200 email domains from inspection.mail, moved whole.

Example request

curl https://panel.example.com/api/v1/migrations/5f1e2d3c-4b5a-4968-8776-a5b4c3d2e1f0/start \
  -H "Authorization: Bearer $VAULTPANEL_TOKEN" -H "Content-Type: application/json" \
  -d '{"sites":[{"root":"public_html","name":"example","domains":["example.com","www.example.com"],"phpVersion":"8.2"}],"databases":[{"source":"shopacct_wp","name":"example_wp"}],"mail":{"domains":["example.com"]}}'
const { migration } = await panel.request('POST', `/migrations/${migrationId}/start`, {
  body: {
    sites: [{ root: 'public_html', name: 'example', domains: ['example.com', 'www.example.com'], phpVersion: '8.2' }],
    databases: [{ source: 'shopacct_wp', name: 'example_wp' }],
    mail: { domains: ['example.com'] },
  },
});

Response 202 Accepted: { migration }, message Moving the websites.

Errors

StatusCodeWhen
409MIGRATION_BUSYThe backup is not read yet, is already being moved, or was moved.
409AGENT_OUTDATEDEmail was picked and the agent is older than 0.50.0.
409MAIL_NOT_SET_UPEmail was picked and the server has no mail server.
409DATABASE_SERVER_NOT_INSTALLED and othersA website or database could not be made: the errors of creating a website or a database.
422VALIDATION_ERRORNothing picked, a folder, database or email domain that is not in the backup, one listed twice, an invalid name or domain, an email domain that has email on another server, or a backup read by an agent too old to list its email.

The MIGRATION_RESTORE job fails with MIGRATION_ARCHIVE_GONE when the backup is no longer on the server, and with IMPORT_FAILED when a database dump cannot be imported (see Import a dump). Mail that cannot be moved for one mailbox does not stop the job: it is listed in result.mailErrors.

Discard a migration

POST/api/v1/migrations/:id/discard
Auth
Session cookie (+ CSRF token) or API token
Permission
websites.manage, databases.manage
Token scope
manage

Removes the backup from the server (MIGRATION_DISCARD) when it is still there, and hides the migration from the list. What was already moved stays.

Response 200 OK: { migration }.

Errors

StatusCodeWhen
409MIGRATION_BUSYThe backup is being read or moved: wait until the current step has finished.