Migrating Debian 9 to another VPS
Generally a pretty easy process. May jinx a few minor things in the process, so make sure to set up the new system as minimal as possible and keep hostname the same. I used rsync and a reboot and it worked better than I dared hope. Requires you to open temporarily root ssh login on source system. Run the following commands from the target (new) system.
# apt-get install rsync
# rsync -auHxv --numeric-ids --exclude=/etc/fstab --exclude=/etc/network/* --exclude=/proc/* --exclude=/tmp/* --exclude=/sys/* --exclude=/dev/* --exclude=/mnt/* --exclude=/boot/* [email protected]:/* /
For some reason /etc/passwd, /etc/group, /etc/shadow was not migrated. After fixing that manually and doing a reboot I was pretty much good to go. To confirm all user files was there, I ran the command
find . -type f | wc -lon the /home/ folder. It was all good.
systemctl statusshowed all good. And did not have any issues with other installed binaries or programs. apt-get update/upgrade also acted nicely.
NOTE: I forgot to remove exim4 in advance, and postfix was less than happy. I tried correcting it but grew tired in the process and just got rid of it all and using sendEmail instead now since I don't need an extensive MTA (it's complete BS that it's still so fussy to set up even close to 2020, just for simple external TLS relaying). See my article here for example usage.
No other issues arised and was in general a very painless process. Yay for Black Friday VPS offers!