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

Chris Frey cdfrey at foursquare.net
Sun Dec 7 20:47:37 EST 2025


Networking may be different when you move from one cloud to another,
starting from the cloud package on up.  The first boot may trigger
things like generating new ssh keys, etc. as well.

Some cloud providers provide mechanisms to boot from a rescue
distro... if so, you could copy even more from the original machine.
Even for VPS machines, I see there is a rescue mode option under "Boot".
If it is similar to the dedicated hardware options, then you're
booting into a custom in-ram distro of Debian (Bookworm I think)
where you can mount the disks and do what you need with them.

Otherwise, I think you're on the right track.

Remember if you have the space on the destination disk, you can always
make a full copy of the source somewhere, so you can grab any missing
things later, in case your --excludes were too strict.

- Chris


On Sat, Dec 06, 2025 at 02:56:48PM -0500, Khalid Baheyeldin wrote:
> 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

> _______________________________________________
> kwlug-disc mailing list
> To unsubscribe, send an email to kwlug-disc-leave at kwlug.org
> with the subject "unsubscribe", or email
> kwlug-disc-owner at kwlug.org to contact a human being.



More information about the kwlug-disc mailing list