Media Gallery

Migrating Debian 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/* root@SOURCE-SERVER-IP:/* /

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 -l on the /home/ folder. It was all good. journalctl -e and systemctl status showed all good. And did not have any issues with other installed binaries or programs. apt-get update/upgrade also acted nicely.

Original Post: Jan 28th, '22 15:19 CET.
Updated: Jun 28th, '22 20:00 CEST.

Tags: GNU/Linux