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”- Open the app or stack drawer (on Apps, a server’s Apps tab, or a project’s Move to server… row action).
- In Move or clone, choose Move to server… or Clone….
- 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.
- If the image is private, pick a registry connection.
- 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).
- Start. A progress panel shows each step with the live output of its agent job.
What happens
Section titled “What happens”- 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.
- 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.
- 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_dnswith the records you need to change. Then Let’s Encrypt certificates are issued on the target, and the source’s domains are held. - 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.
- 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.
Copy a site to another server
Section titled “Copy a site to another server”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.
Automate it
Section titled “Automate it”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).
| Step | MCP tool | REST |
|---|---|---|
| Start a move or clone | moves_create (level full + backups:restore) | POST /v1/moves |
| Follow it | moves_get, moves_list (?serverId=&kind=&name=&open=1) | GET /v1/moves/{id}, GET /v1/moves |
| Cut over by hand | moves_cutover (status ready) | POST /v1/moves/{id}/cutover |
| Confirm DNS changed by hand | moves_dns_done (status waiting_dns) | POST /v1/moves/{id}/dns-done |
| Change the keep period | moves_keep (days: 0, 1, 3, 7, 14; sites:delete) | POST /v1/moves/{id}/keep |
| Delete the old copy now | moves_finish (sites:delete, no rollback after) | POST /v1/moves/{id}/finish |
| Roll back | moves_rollback (sites:delete) | POST /v1/moves/{id}/rollback |
| Retry a failed step | moves_retry (status failed) | POST /v1/moves/{id}/retry |
| Copy a site to another server | sites_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 formoves_cutover(auto-cutover off),waiting_dns: change the records listed in the move, thenmoves_dns_done,confirming: cut over, the old copy is kept (moves_keep,moves_finish,moves_rollback),done,failed(thenmoves_retry) orrolled_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.
Gotchas & troubleshooting
Section titled “Gotchas & troubleshooting”409 bad_state. The action doesn’t fit the current status (for examplemoves_cutoverwhen the move is notready). Readmoves_getfirst.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.
Related
Section titled “Related”- Apps · Docker apps & stacks
- Projects: clone a whole environment at once.
- Staging & deploys: same-server site clones and push-to-live.