Linux VPS

Migrate from an OpenVZ or LXC VPS to a KVM VPS

Move websites, databases and services from a container-based OpenVZ or LXC VPS to a KVM VPS: why moving beats converting, inventory, preparing the KVM server, copying data and switching over.

IntermediateLinux VPS2 min read

Many older or budget VPSs run on OpenVZ or LXC containers, which cannot run Docker properly, load kernel modules or use modern kernels. Moving to KVM removes those limits. This guide shows how to migrate from OpenVZ to a KVM VPS safely.

Before you start

  • Confirm your current virtualization: systemd-detect-virt prints openvz or lxc; see OpenVZ explained.
  • A new KVM VPS sized for your needs; see VPS sizing.
  • A full backup of the old server and DNS access.

Why move rather than convert

A container has no kernel, bootloader or partition table of its own, and often runs an old distribution because of the host kernel. Copying it into a KVM disk is possible but usually brings old problems along. Building a fresh KVM server and moving data is cleaner and lets you upgrade the OS at the same time.

Take an inventory

  • OS version and installed packages: dpkg -l or rpm -qa.
  • Services and their configs (web server, PHP, database, mail, cron jobs).
  • Data paths: web roots, uploads, databases, home directories.
  • Firewall rules, SSL certificates, users and SSH keys.

Prepare the KVM server

  1. Install a current OS and secure it: first steps on a new VPS.
  2. Install the same software stack in current versions.
  3. Now you can use features unavailable before: Docker, WireGuard (WireGuard setup), swap or zram, custom kernel settings.

Copy data

From the new server:

rsync -aHAX --info=progress2 root@OLD_IP:/var/www/ /var/www/
ssh root@OLD_IP "mysqldump --all-databases --single-transaction --routines --events" | mysql

Review configs before copying them; paths and versions may differ. Full procedure: migrate a VPS with rsync.

Test and switch over

  1. Test sites via your local hosts file pointing to the new IP.
  2. Lower DNS TTL in advance, then stop writes on the old server and do a final rsync and database dump.
  3. Update DNS, issue SSL certificates, check email settings (SPF, reverse DNS).
  4. Keep the old VPS for a few days, then cancel it once everything is verified.

Troubleshooting

  • Old software will not run on the new OS: upgrade the application, or run it in a container with the older runtime.
  • Permissions wrong after copy: users have different UIDs; create users first or fix ownership.
  • Mail rejected: new IP lacks reverse DNS or SPF update.

Frequently asked questions

Can my provider convert the VPS for me?

Some offer migration help; container-to-KVM is usually a rebuild either way.

Will my IP stay the same?

Usually not, unless the provider can move the IP to the new server.

Is KVM more expensive?

Sometimes slightly, but you get dedicated RAM, your own kernel and better isolation.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.