guides
Migrate a Server
Use excloud-migrate to copy a running server's whole disk to a new Excloud VM booted in rescue mode, then cut over with minimal downtime.
excloud-migrate copies a source machine’s entire disk, block for block, over an encrypted (TLS) connection to a new Excloud VM. The source keeps running while the bulk of the data is copied; only a short seal at the end freezes the source’s filesystems so the final delta is consistent. This keeps downtime to the cutover window rather than the whole copy.
There are two roles:
- Receiver — the new Excloud VM whose raw disk is overwritten with the source’s data. It must be booted in rescue mode so nothing is mounted on the disk being written.
- Source — the machine you are migrating from. It runs live; you only pause it at cutover.
Prerequisites
- A receiver VM with a disk at least as large as the source. Create a new instance (Deploying Ubuntu) whose root disk is equal to or larger than the source disk. A smaller destination is rejected.
- The same security group as the source, so the two machines can reach each other. See Security Groups.
- TCP port
7443open between them. The receiver listens on7443; the source connects to it. Make sure your security group allows this port from the source to the receiver. - Root (
sudo) access on both machines.
Step 1 — Boot the receiver in rescue mode
You cannot overwrite the disk you are booted from, so the receiver boots into a temporary Alpine recovery environment while its original disk stays attached but unmounted.
-
Open the console, go to the receiver instance, and from its actions menu choose Rescue Mode → Enable Rescue Mode. The instance restarts into the recovery environment.
-
SSH into the receiver as the
alpineuser with one of your organization’s SSH keys:ssh alpine@<receiver-ip> -
Identify the disk to migrate onto. The recovery system boots from its own overlay, so your real disk is a separate device:
lsblkOn most Excloud instances the original disk appears as
/dev/nvme0n1. Confirm the size matches the disk you provisioned before continuing.
Step 2 — Download the migration tool
Run this on both the receiver (in rescue mode) and the source. It is a single static binary with no dependencies.
wget -O excloud-migrate https://repo.excloud.in/bin/excloud-migrate-0.3.2
chmod +x excloud-migrate
Optionally, check what the source will migrate before you start — this prints the source’s root disk, mounted filesystems, and swap devices as JSON:
sudo ./excloud-migrate preflight
Step 3 — Start the receiver
On the receiver, point --destination at the disk you identified and --advertise at an HTTPS URL the source can reach (its private IP and port 7443):
sudo ./excloud-migrate receive --destination /dev/nvme0n1 --advertise https://10.0.0.12:7443
The receiver prints the session details and a ready-to-paste command for the source, including a one-time secret:
session: <id>
destination: /dev/nvme0n1 (… bytes)
cutover: automatic after the initial copy
source command:
sudo excloud-migrate send --receiver https://10.0.0.12:7443 --secret <SECRET> --manual-unseal
commands: status, seal, abort, help
Leave this running. At the receiver prompt you can type status to see progress, abort to cancel, or help.
Step 4 — Start the source
On the source machine, run the exact command the receiver printed. It already contains the secret and the --manual-unseal flag:
sudo ./excloud-migrate send --receiver https://10.0.0.12:7443 --secret <SECRET> --manual-unseal
The source auto-selects its root disk (pass --source /dev/… to choose a different whole disk). It connects to the receiver and begins copying.
Step 5 — Cut over
- The initial copy runs while the source stays online. Once it completes, the tool automatically seals: it briefly freezes the source’s filesystems, copies the final delta, and finalizes the destination disk.
- Because you used
--manual-unseal, the source then reports that its filesystems remain frozen and waits. Do not press Enter yet. - On the receiver, choose Exit Rescue Mode in the console. The VM restarts and boots from the freshly copied disk — this is now your migrated machine. Verify it comes up and looks correct.
- Once you’re satisfied, return to the source and press Enter to unseal (thaw) it, then shut the source down and decommission it.