Bỏ qua để đến nội dung
Moves & clones Move or clone a Docker app or stack to another server with its data, database and domains, or copy a site of any type to another server, with the exact stages, statuses, errors and MCP sequence.

Moves & clones

Nội dung này hiện chưa có sẵn bằng ngôn ngữ của bạn.

MZPanel can move a Docker app or stack to another of your servers, or clone it there under a new name and domain, with its data: volumes, the attached database, the sealed env store, build args and container cron tasks. A move runs on the control plane as a durable, resumable process, so you can close the drawer and come back. Sites of every type are copied to another server with a cross-server site clone. All of this needs the Pro plan or higher.

Move or clone an app or stack, step by step

Section titled “Move or clone an app or stack, step by step”
  1. Open the app or stack drawer (on Apps, a server’s Apps tab, or a project’s Move to server… row action).
  2. In Move or clone, choose Move to server… or Clone….
  3. Pick the target server. For a move, choose offline (stop the source first, the default and safest for databases) or live. For a clone, enter the new name and domain.
  4. If the image is private, pick a registry connection.
  5. Choose how long to keep the old copy after a move (0, 1, 3, 7 or 14 days, default 7) and whether to cut over automatically once the copy is verified (default on).
  6. Start. A progress panel shows each step with the live output of its agent job.
  1. Preflight: both servers online (agent 0.2.122 or later), the app or stack exists on the source, its name and domains are free on the target, and no other move of it is open.
  2. Copy: stop the source (offline move), pull private images on the target, take a one-off backup (with the image for a git-built app), transfer it (through an object destination if you have one, else directly over SSH), and restore it on the target with its domains held.
  3. Cutover: the target serves the domains first and MZPanel checks each answers over HTTPS. Then DNS moves: names in a connected Cloudflare zone are repointed (AAAA records are deleted when the target has no IPv6, and restored on rollback). For other zones the move waits in waiting_dns with the records you need to change. Then Let’s Encrypt certificates are issued on the target, and the source’s domains are held.
  4. Confirm: the stopped source is kept for the chosen period, then deleted with its data. Until then you can Roll back: DNS points back, the source starts again, the target copy is removed.
  5. Cleanup: the transfer archive and the one-off backup are deleted once the move is finished or rolled back.

A clone never stops or changes the source; it ends when the copy serves its own domain. If the attached database name already exists on the target, the copy gets its own database (<name>_<6 hex>) and its env points at it. Tags, notes, webhooks and git build settings follow a moved app; scheduled backup jobs do not, so create one on the target afterwards.

Any site type (WordPress, static, PHP, Node.js, Python, Go) can be cloned to another server under a new domain from the site’s clone drawer, by choosing a target server. Files, database and config are copied and the site is served on the target. Overwriting an existing site on the target is WordPress-only. There is no move or automatic DNS cutover for sites: point DNS yourself, then delete the source if you no longer need it.

A WordPress copy keeps the source’s PHP version when the target has it. If the target lacks it, the copy runs on the target’s default PHP and the result says so; a target with no PHP at all is refused before any file is copied. A copy that fails part-way removes what it created on the target (agent 0.2.173 or newer), so you can retry.

REST and MCP are on every plan; these operations need Pro (403 tier_required below it). Moves span two servers, so a token limited to a server allowlist is refused (fleet_wide).

StepMCP toolREST
Start a move or clonemoves_create (level full + backups:restore)POST /v1/moves
Follow itmoves_get, moves_list (?serverId=&kind=&name=&open=1)GET /v1/moves/{id}, GET /v1/moves
Cut over by handmoves_cutover (status ready)POST /v1/moves/{id}/cutover
Confirm DNS changed by handmoves_dns_done (status waiting_dns)POST /v1/moves/{id}/dns-done
Change the keep periodmoves_keep (days: 0, 1, 3, 7, 14; sites:delete)POST /v1/moves/{id}/keep
Delete the old copy nowmoves_finish (sites:delete, no rollback after)POST /v1/moves/{id}/finish
Roll backmoves_rollback (sites:delete)POST /v1/moves/{id}/rollback
Retry a failed stepmoves_retry (status failed)POST /v1/moves/{id}/retry
Copy a site to another serversites_clone_xserver (level full)POST /v1/servers/{id}/clone-xserver

moves_create body: kind (app or stack), name, srcServerId, dstServerId, and optionally mode (move or clone), offline (move, default true), newName and newDomain (clone; newDomain required), registryConnectionId, autoCutover (default true), keepDays (default 7). It returns 201 at once; poll moves_get until the status is:

  • ready: copy verified, waiting for moves_cutover (auto-cutover off),
  • waiting_dns: change the records listed in the move, then moves_dns_done,
  • confirming: cut over, the old copy is kept (moves_keep, moves_finish, moves_rollback),
  • done, failed (then moves_retry) or rolled_back.

sites_clone_xserver body: dstServerId, sourceDomain, newDomain, optional overwrite (WordPress only). It is org owner/admin only and both servers must be online. The response is an event stream (phases export, authorize, transfer, import) that ends in a done or error event; there is no job to poll. Point DNS for the new domain at the target afterwards. When the WordPress copy fell back to the target’s default PHP, done.data.result.php_note explains it; error code php_not_installed means the target has no PHP version installed.

  • 409 bad_state. The action doesn’t fit the current status (for example moves_cutover when the move is not ready). Read moves_get first.
  • 409 busy. A step is running. Retry shortly.
  • A domain isn’t served on the target. The cutover re-checks up to three times and then fails with DNS untouched, so traffic stays on the source. Fix the target and call moves_retry.
  • Finish is final. After moves_finish (or when the keep period ends) the source is deleted with its database and volumes, and there is no rollback.
  • Both servers must be online for the copy and cutover steps.