[kwlug-disc] Migrating a VPS to new provider ...

Khalid Baheyeldin kb at 2bits.com
Sat Dec 6 14:56:48 EST 2025


When one is upgrading a Linux machine at home or work, whether it is a
desktop or a server, the procedure is basically a solved problem.

If the disk on the old machine is up to spec, then one can just unplug it
from the old machine, and plug it in the new one, and things should
continue to work as expected.

If the new disk is faster, then one can still copy the old disk to it,
either by plugging the old one in the new machine, or over the LAN
connection (which I detailed in the article: How To Migrate Old Linux
Computer Disk To A New Computer
<https://baheyeldin.com/linux/how-to-migrate-old-linux-computer-disk-to-new-computer.html>
).

But, if your server is a VPS image, things are not as straightforward ...
This is in preparation of moving one VPS from Linode to the cheaper OVH,
per the recent discussion thread ...

Let us go with the assumption that both VPS are the same distro and version
(Ubuntu Server 24.04 LTS in this case), to simplify things.
I want all the packages, and their current configurations, as well as my
own directories, to be moved over.

Some people have written guides (e.g. this one
<https://blog.racknerd.com/how-to-migrate-from-old-vps-to-new-vps-using-rsync-migrating-a-linux-vps/#Creating_the_Exclusion_List>)
on how to do that, using rsync and an exclude list.
But I find that the exclude list is too long, and includes things that
should not be excluded (like /etc/default, /boot, /var/log, ...etc.)
If I want everything to end up being the same on the new VPS, then
everything should be moved over, excluding special directories (/proc,
/sys, ...) and the network configuration.

As an example, /var/cache/apt should be included (but
/var/cache/apt/archives/* can be excluded)

Should /lib/modules, and /lib64/modules be excluded?
On my Linode VPS, it contains many modules with "linode" in the name.
So it has some provider specific stuff, and for that reason, it should be
excluded, I think.

I came up with this much shorter list:

/etc/fstab
/etc/systemd/network/*
/etc/network/*
/etc/netplan/*
/etc/networks
/etc/netconfig
/etc/resolv.conf
/etc/hostname
/etc/hosts
/etc/machine-id
/var/lib/dbus/machine-id
/proc/*
/tmp/*
/sys/*
/dev/*
/mnt/*
/run/*
/var/run/*
/var/lock/*
/lost+found
/swapfile
/swap.img
/var/crash/*
/var/cache/apt/archives/*
/lib/modules/*
/lib/firmware/*
/lib64/modules/*
/lib64/firmware/*

Thoughts? Comments?

-- 
Khalid M. Baheyeldin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kwlug.org/pipermail/kwlug-disc_kwlug.org/attachments/20251206/c3049483/attachment.htm>


More information about the kwlug-disc mailing list