Stack Migration
Stack Migration moves a running stack from one host to another, including named volumes, with pre-flight checks, health verification, and automatic rollback on failure.
When to migrate
Section titled “When to migrate”- Decommissioning a host
- Rebalancing load across a fleet
- Moving from bare metal to a VM (or the other way)
- Consolidating staging onto fewer hosts to save cost
Running a migration
Section titled “Running a migration”- Open the stack’s detail page
- Actions → Migrate to host
- Pick the destination host
- Review the pre-flight report
dockmesh runs these checks before touching anything:
| Check | What it validates |
|---|---|
| Image availability | Destination host can pull every image referenced |
| Port conflicts | No static host ports on the destination collide |
| Volume capacity | Destination has enough free disk for each volume |
| Docker version | Destination runs a compatible Docker version |
| Network mode | host networking works on destination if used |
If any check fails, migration is blocked and you see a list of remediation steps.
What happens during migration
Section titled “What happens during migration”- Source stack is stopped (or kept running if
--liveis checked for read-mostly workloads) - Named volumes are streamed over mTLS from source to destination using tar + chunked transfer
compose.yamlis copied to the destination- Stack is started on the destination
- Health checks run for up to 60 seconds (or the configured health check timeout)
- On success: source volumes are kept for 24h as a safety window, then pruned
- On failure: destination stack is removed, source is restarted, alert is raised
The entire flow is one atomic operation from the user’s perspective — if any step fails, you end up back where you started.
Bind-mount volumes
Section titled “Bind-mount volumes”Bind-mounted paths (e.g. /opt/data:/app/data) are not migrated automatically — they point to host-specific paths. The pre-flight report flags these and you must either:
- Ensure the same path exists on the destination (you handle the data copy yourself)
- Convert the bind mount to a named volume first, then migrate
Rollback
Section titled “Rollback”Every migration creates a rollback plan that is stored until the safety window expires. From the audit log you can Rollback any migration — dockmesh will stop the new stack and restart the old one from the retained volumes.
See also
Section titled “See also”- Drain Host — bulk-migrate all stacks off a host
- Backup & Restore — pair with a backup before risky migrations