Migrate a server
Move a Linux server from AWS, Google Cloud, Azure, DigitalOcean, another VPS provider or your own hardware onto one of your instances. Your applications, websites, databases, users and settings come along. Open Migrations in the menu.
A small agent runs on the source (and, unless the portal prepares it, on the destination). The source copies its files straight to the destination over SSH; nothing passes through this portal, which only coordinates and shows progress. The copy uses rsync, so:
- an interrupted copy resumes where it stopped when you run the source command again;
- every pass after the first only sends what changed.
Owners, Admins and Developers can start and manage migrations; everyone in the organization can follow them.
The portal can do most of the work for you; each part is optional and chosen when you start the migration:
- start the agent on the source by logging in with a password or SSH key you give it;
- prepare the destination: install the source's operating system on it and let the source in, so nothing runs there by hand;
- stop your applications on the source right before the last pass, at a time you pick;
- reboot and check the destination afterwards;
- point your DNS at the destination (Cloudflare or DigitalOcean DNS).
With all of them on, you only fill in the form and select Finish migration.
Move a server to another cloud (one click)
For a server that is already in the portal, on any connected cloud (your own DigitalOcean, Vultr, Akamai, Hetzner, AWS, Google Cloud, Azure or Virtualizor account, or a server you ordered here), the portal does every step itself. Open the server and select Move to another cloud, or Migrations › Move a server to another cloud.
-
Server to move: pick it.
-
Where it goes: one of your cloud accounts that can create servers (the provider bills it), or this platform's servers (charged hourly from your balance). Only clouds connected in the current organization are listed. Providers you haven't connected there yet are shown below them with a Connect link. Then:
- Region.
- Size: sizes with at least the source's memory and disk are marked Fits; the cheapest one that fits is chosen for you.
- Operating system: only images of the same distribution and major version as the source can be picked (e.g. Ubuntu 22.04 for an Ubuntu 22.04 server). The portal checks it again against what the source agent reports before creating anything.
- Name of the new server (optional;
<source>-migratedby default).
-
How it moves: Live (recommended) or One pass, and three switches, all on by default:
- Stop the applications for the last pass: every application on the source (web servers, databases, mail, Docker…) is stopped right before the last pass, so nothing changes during it. If that pass fails or you cancel, the source starts them again. When the migration completes they stay stopped on the source and start on the new server when it reboots.
- Fix the old IP address in copied files: see The old IP address.
- Reboot and check the new server after the finish.
-
Starting the agent on the source. How depends on where the source runs:
Source What you enter Microsoft Azure Nothing: Azure's Run Command starts the agent (the VM needs its Azure agent, which Azure's Linux images have). Google Cloud Nothing: the portal adds a temporary SSH key to the instance's metadata, logs in with it once and removes it. Not with OS Login turned on. AWS Nothing: the portal pushes a temporary key with EC2 Instance Connect (valid for 60 seconds). The image needs ec2-instance-connect(Ubuntu and Amazon Linux have it), SSH must be open to the portal, and the IAM user needsec2-instance-connect:SendSSHPublicKey.DigitalOcean, Vultr, Akamai, Hetzner, Virtualizor The source's root password or SSH private key (or a user with passwordless sudo). It is used once to start the agent and is never stored.You can also choose I run a command on the source: the next page shows one command to paste there.
-
Tick the confirmation and select Move server.
The page that follows shows each step under Done for you: starting the agent, creating the destination (once the agent has reported, so it gets exactly the source's operating system), the copy, the finish and the checks. If the agent can't be started, Try again lets you enter a login. Cancel migration can also delete the server the portal created.
The old IP address
Configuration and website files often contain the server's own IP address (a web server's listen 203.0.113.7:443, an application's .env, DNS zone files). After each pass the agent looks for the source's addresses in /etc, /opt, /srv, /var/www, /usr/local/etc, DNS and control-panel directories and /home/*/public_html, in text files up to 1 MB. Ready to finish lists the files it found.
With Replace them during the finish ticked, the last pass replaces each old address with the new server's address of the same kind (public for public, private for private) in those files, on the new server only. Each changed file's original is kept next to it as <file>.cmp-bak. Files the destination keeps its own version of (network settings, /etc/hosts, SSH) are never touched.
Licences tied to the address
Control panels such as cPanel/WHM, Plesk, DirectAdmin, CloudLinux, Webuzo and Softaculous are licensed for the server's IP address. The migration page warns you when the source has one: move the licence to the new address with its vendor or your licence provider, or the panel stops working on the new server.
Verification and the old server
After the reboot the portal checks every port the source served to the internet on the new server's address, and asks the web ports (80, 443) for a page; the results are in the Verification table. When everything checks out and DNS points at the new server, Power off the source from the same page (nothing is deleted; delete it later from its page).
When servers can't reach the portal's address
The agents call the portal from the servers being migrated. If those servers reach the portal by a different address than the one you use, for example over a private network, your provider sets that address for the agents. Ask your provider if agents report Could not reach the portal.
Before you start
- Create the destination instance with a disk larger than the data on the source. See Create an instance. Its operating system should be the same, and the same major version, as the source (for example Ubuntu 22.04 to Ubuntu 22.04); if the portal prepares the destination, it installs the right one for you.
- Back up the destination if anything on it matters: its files will be replaced. See Backups.
- The source needs Python 3 (almost every Linux has it). You need root on it (or a user with
sudo), either to run the command or for the portal to log in. - The source must be able to reach the destination on its SSH port (usually 22). Allow it through any firewall.
Start a migration
Select Start a migration:
- Source: where the server runs now, and a name for it (its hostname or IP). This is only a label; the agent needs no access to that cloud's account.
- How the agent starts on the source:
- I run a command (default): you get one command to paste on the source. The portal never holds a login for it.
- The portal logs in and starts it: enter the source's public IP address or hostname, SSH port, user (
root, or a user that can usesudowithout a password) and its password or private key (without a passphrase; for a DigitalOcean droplet, the key you log in with). The portal connects over SSH from the internet, so the source's firewall must allow it. The login is stored encrypted and deleted when the copy completes or the migration is cancelled or expires.
- How the agent starts on the source:
- Destination: the instance it moves onto.
- Install the source's operating system on it for me: available for instances created in this portal on our clouds. As soon as the source agent reports, the portal reinstalls the destination with the same operating system and version and lets the source in: there is no destination command. If no image matches, or the destination's disk is too small for the source's data, it stops and says why.
- Method:
- Live (recommended): the source keeps running. After the first copy you can copy the changes again as often as you like, and finish when you are ready. Downtime is only the last, short pass.
- One pass: one copy, then the migration finishes by itself. Stop your applications and databases on the source before you start.
- After the copy (optional):
- Reboot the destination and check it: after the migration the portal reboots the destination, then checks that every port the source served on the internet (SSH, web, mail, …) answers on it, for up to 10 minutes.
- Point my DNS at the destination: choose Cloudflare or DigitalOcean DNS, and enter the domain, the records (names in the domain separated by spaces;
@is the domain itself, e.g.@ www) and an API token (Cloudflare: Zone › DNS › Edit for that domain; DigitalOcean: write access). The token is checked when you create the migration. Once the checks pass, the portal points those A records at the destination's IP address (and creates any that don't exist), then deletes the token. If you don't choose the reboot, a Switch DNS now button appears when the migration completes.
- Confirm that the destination's files will be replaced, and select Create migration.
Run the agents
The migration's page shows the commands you still need. Copy them with Copy and run each as root:
- On the destination first (not shown when the portal prepares it). It lets the source in, for this migration only, and finishes within seconds. Its SSH key is limited to this migration and expires with it.
- Then on the source (only if the portal does not start it, or could not). It starts copying straight away. Run it inside
screenortmux, so it keeps going if you disconnect.
Each command shows Agent connected in the portal while it runs. Keep the commands private: anyone who has them can take part in this migration until it ends.
The destination agent also sends the destination's SSH host keys through the portal, and the source only connects to a server presenting one of them. If you reinstall the destination during a migration, run the destination command again: the source then trusts the new keys. When the portal prepares the destination, it reads the keys itself right after the install.
Done for you
When the portal does any of the steps, the Done for you panel on the migration's page shows each one: not started, running, done, or failed with the reason.
- Start the source agent failed (wrong password, firewall, no Python…): fix the cause and select Try again, or run the source command yourself.
- Prepare the destination failed: fix the cause (for example resize the destination) and select Prepare again, or reinstall it yourself and run the destination command.
- Check the destination lists any port that did not answer. The DNS records are then left alone: check those services, then select Switch DNS now.
Follow the copy
The page updates by itself: percentage, data copied, speed and time left. If both servers have reported, it also warns you when:
- the operating systems differ: the copy does not start until they match, because the source's programs would not run on the destination's kernel and boot setup (SSH would stop working first). Reinstall the destination with the source's operating system and run the destination command again; or
- the destination has less free space than the data on the source.
If the copy stops (the network dropped, the source rebooted, you pressed Ctrl+C), the page shows Interrupted and why. Fix the cause and run the source command again; files already copied are not sent again.
Limit the bandwidth
By default the copy uses as much of the source's network as it can, which can slow its websites while the copy runs. To prevent that:
- When you start a migration: enter a Bandwidth limit in Mbit/s, in either wizard. For example, 100 Mbit/s leaves most of a 1 Gbit/s connection for visitors.
- While it runs: change it under the progress bar on the migration's page, and select Change. Leave the field empty to remove the limit.
A change reaches the source agent within seconds. A pass that is running restarts with the new limit, and files already copied are not sent again. The page shows the limit next to the current speed.
Finish
Live migrations stop at Ready to finish after the first copy. The source is still running, so its data keeps changing:
- Select Sync changes as often as you like. Each pass is quick, because it only sends what changed.
- Under Stop on the source before the last pass, tick the applications to stop (web servers, databases, Docker… — the agent lists what runs on the source; system services such as SSH are never offered). The agent stops them right before the last pass, so nothing changes during it. They stay stopped on the source and start on the destination when it reboots.
- Choose Now, or At a date and time (in your browser's time zone, before the migration expires), and select Finish migration or Schedule finish. A scheduled finish shows on the page; to change it, finish now or pick another time.
- The source agent copies the last changes. Then the destination takes over the source's SSH host keys, so your SSH clients don't warn about a changed server, and root's SSH keys.
One-pass migrations finish by themselves after the copy.
When the migration shows Completed:
- Reboot the destination so it starts the copied services: the portal does it if you chose Reboot the destination and check it; otherwise use the button on the page.
- Check it. Log in over SSH: the source's root password and keys now work. Make sure your services run and test your sites.
- Point your DNS at the destination's IP address, unless the portal does it for you. Lower the records' TTL a day before to make the switch quick.
- Keep the source for a few days as a fallback, then delete it.
What is copied and what is kept
Copied from the source: everything on its local disks, including:
- programs and packages;
- websites and data, including databases;
- users, groups and passwords;
- settings in
/etc; - scheduled tasks;
- Docker images and volumes.
Files on the destination that the source doesn't have are deleted.
Kept on the destination, so it starts and reaches the network on its new cloud:
- its kernel and boot loader (
/boot, kernel modules); - its disk layout (
/etc/fstab); - its network settings and IP addresses;
- its hostname,
/etc/hostsand DNS resolver; - its cloud-init.
Not copied:
- network shares, temporary files and swap;
- other mounted filesystems that aren't local disks.
After the migration, the destination runs the source's programs on its own kernel. Install the latest updates once it's running (apt upgrade or dnf upgrade).
Cancel or remove
- Cancel migration stops the source agent and removes the source's key from the destination. Files already copied stay on the destination; reinstall it to start clean.
- Migrations expire after 7 days. The agents stop working, and the destination stops accepting the source's key by itself.
- Finished or cancelled migrations can be removed from the list with Remove from list.
Notifications
Notification channels can announce Migration started, Migration completed, Migration interrupted and Migrated server failed its checks. See Notifications and webhooks.
Troubleshooting
-
"The portal could not log in … the password or key was refused": check the user and password or key. Many clouds switch off password logins for root; use the SSH key instead.
-
"The portal cannot reach …": the source's firewall (or the cloud's, such as a DigitalOcean Cloud Firewall) blocks SSH from the internet. Allow port 22 for a while, or run the source command yourself.
-
"No operating system image on this cloud matches the source": reinstall the destination yourself with the closest operating system and run the destination command, or ask support to add the image.
-
"Host key verification failed": the destination was reinstalled (or replaced) after its agent ran. Run the destination command again; the source picks up the new keys within a few seconds.
-
The source waits with "The destination does not answer yet": it keeps trying for 10 minutes, for example while the destination is still being installed. After that the migration shows Interrupted; run the source command again.
-
"Cannot run rsync on the destination … over SSH": the source can't reach the destination's SSH port, or the destination agent didn't finish. Check firewalls and security groups, run the destination command again, then the source command.
-
"Root login over SSH is switched off": on the destination, set
PermitRootLogin prohibit-passwordin/etc/ssh/sshd_config, restart SSH (systemctl restart sshorsshd), and run its command again. -
"Some files could not be copied": usually files that changed or disappeared during a live copy. Run Sync changes, or finish with your applications stopped.
-
The destination doesn't start after the reboot: open its console to see why. The most common cause is a different operating system from the source; reinstall the destination with the source's operating system and migrate again.