Migrate a server to CheapVPS

A migration is a copy, not a move: build the new server next to the old one, sync files with rsync, restore databases from fresh dumps, then switch DNS once everything checks out. With a lowered DNS TTL and a final sync, downtime is usually a few minutes, and the old server stays ready as your rollback.

Getting started and billing guide, updated 2026-12-03

What should you inventory before you start?

Spend half an hour listing what the old server actually does. On the old machine:

cat /etc/os-release
systemctl list-units --type=service --state=running
ss -tlnp
crontab -l; ls /etc/cron.d
df -h; du -sh /var/www /var/lib/mysql /var/lib/postgresql /var/lib/docker 2>/dev/null
docker ps --format "{{.Names}} {{.Image}}" 2>/dev/null

Write down the services, the ports they listen on, scheduled jobs, the data directories and their sizes, the domains served and where their DNS is hosted. Note anything that depends on the old IP address: mail SPF records, API allow lists at partners, firewall rules elsewhere. This list becomes your checklist for the cutover.

How do you pick the plan and city?

Look at real usage, not the old plan name. Check memory with free -h, CPU load over a day with uptime or your monitoring, and disk with df -h. Choose a plan with memory headroom of about a third and disk room for growth plus a temporary copy of your databases.

For a typical web application with a database, P4 (2 vCPU, 4 GB RAM, 80 GB NVMe, $12.05 a month) is a sensible start; a heavy database may fit D8 with 2 vCPU, 8 GB RAM, 80 GB NVMe. Pick the city closest to your users from the 15 on the locations page. Prefer the same distribution and major version as the old server, so config files copy over without surprises; Ubuntu 24.04 and Debian 13 are good targets for older systems you want to modernise.

How do you prepare the new server?

Create the server as described in create your first server, log in and update it. Then install the same stack. A typical LAMP or LEMP set on Ubuntu 24.04:

apt update && apt full-upgrade -y
apt install nginx php8.3-fpm php8.3-mysql php8.3-xml php8.3-curl php8.3-mbstring mariadb-server rsync

On Rocky Linux or AlmaLinux use dnf install with the matching package names. Create the same users the application expects, with the same names, before you copy files; rsync keeps ownership by name when you use the flags below. Allow SSH from the new server to the old one with a dedicated key:

ssh-keygen -t ed25519 -f /root/.ssh/migrate -N ""
cat /root/.ssh/migrate.pub   # add this line to authorized_keys on the old server

How do you copy files with rsync?

Pull files from the new server, so the old one only needs SSH. The first pass can run while the site is live:

rsync -aHAX --numeric-ids --info=progress2 -e "ssh -i /root/.ssh/migrate" \
  root@198.51.100.20:/var/www/ /var/www/

The trailing slashes matter: they copy the contents of the directory, not the directory into itself. -a keeps permissions, times and links, -H hard links, -A and -X ACLs and extended attributes. Repeat for other data directories, and copy selected config files rather than all of /etc, which contains machine-specific settings such as network configuration and host keys.

Run the same command again just before cutover. Only the changes travel, so the second pass is short. Add --delete on that final pass if files were removed on the old side.

How do you move MySQL, MariaDB and PostgreSQL databases?

Never copy a running database directory. Make a consistent dump instead. For MySQL or MariaDB with InnoDB tables:

ssh -i /root/.ssh/migrate root@198.51.100.20 \
  "mysqldump --all-databases --single-transaction --routines --events" > /root/all.sql
mysql < /root/all.sql

For PostgreSQL, dump each database in custom format and restore it, after creating roles:

ssh -i /root/.ssh/migrate root@198.51.100.20 "sudo -u postgres pg_dumpall --roles-only" > roles.sql
ssh -i /root/.ssh/migrate root@198.51.100.20 "sudo -u postgres pg_dump -Fc appdb" > appdb.dump
sudo -u postgres psql -f roles.sql
sudo -u postgres createdb -O app appdb
sudo -u postgres pg_restore -d appdb --no-owner --role=app appdb.dump

Do a test restore first, while the site is live, and check row counts on a few large tables. At cutover you repeat the dump after stopping writes on the old server.

How do you move Docker volumes and compose projects?

Copy the compose directory, then the volumes. Stop the stack briefly on the old server so volume data is consistent:

# old server
cd /opt/app && docker compose stop
tar -C /var/lib/docker/volumes -czf /root/volumes.tgz app_data app_db
# new server
rsync -a -e "ssh -i /root/.ssh/migrate" root@198.51.100.20:/opt/app/ /opt/app/
rsync -a -e "ssh -i /root/.ssh/migrate" root@198.51.100.20:/root/volumes.tgz /root/
cd /opt/app && docker compose create
tar -C /var/lib/docker/volumes -xzf /root/volumes.tgz
docker compose up -d

Use your real volume names from docker volume ls. On Arm64 plans make sure every image in the compose file has an Arm64 build. The Docker Compose guide covers the base install.

How do you plan the DNS change?

DNS answers are cached for the TTL of the record, so lower it well ahead. One or two days before cutover, set the TTL of the A and AAAA records to 300 seconds at your DNS provider. After the old TTL has passed, every resolver will check again within five minutes.

Test the new server before DNS points at it by overriding resolution on your own computer:

curl -I --resolve example.com:443:203.0.113.10 https://example.com/

Or add 203.0.113.10 example.com to your hosts file and browse normally. For HTTPS, copy /etc/letsencrypt along with the files, or issue certificates after the switch as in nginx with HTTPS.

How does the cutover go, step by step?

  1. Put the application in maintenance mode or stop writes on the old server.
  2. Run the final rsync passes with --delete.
  3. Take the final database dumps and restore them on the new server.
  4. Start the services on the new server and check logs: journalctl -u nginx -n 50.
  5. Change the A record to the new IPv4 and the AAAA record to an address from the new IPv6 network.
  6. Watch traffic arrive with tail -f /var/log/nginx/access.log on the new server.
  7. Recreate cron jobs and check that backups and monitoring point at the new server.

Most cutovers of a single web server take a few minutes of write downtime. Raise the TTL back to a normal value after a day.

How do you roll back if something breaks?

Keep the old server untouched for at least a few days. If the new one misbehaves, point the DNS records back to the old IP; with a 300 second TTL, traffic returns within minutes. Any data written on the new server in the meantime has to be copied back, which is why a short maintenance window and a quick check right after cutover are worth it.

Once everything has run cleanly for a while, cancel the old service and, if the data was sensitive, wipe it there. On our side, review the firewall setup and backups for the new server.

Questions about this guide

Can support migrate the server for me?

Migrations are done by you; there are no managed services. This guide covers each step, and support can answer questions about our side in a ticket.

Can I keep my old IP address?

No. Addresses belong to the provider and the city. Plan the DNS change and update any allow lists that use the old IP.

Can I upload a disk image of the old server?

There is no image import or custom ISO. Install from one of our images and copy your data and configuration over.

How long does a migration take?

Copy time depends on data size and both networks. The downtime itself is the final sync and DNS switch, often a few minutes.

Should I change the distribution during a migration?

Only if you have time to test. Keeping the same distribution and major version makes config files copy over cleanly.

What about mail on the old server?

Plan it separately: MX records, SPF and reverse DNS. Outgoing port 25 needs a request to support first.