Best Solution for Migrations

Howdy!

I’m now in a position where I’m moving from a dedicated server (running Ubuntu 18.04) to an OVZ 7 VPS that will also run Ubuntu 18.04 due to budget constraints.

So here is the deal, every time I had to make a move it is a pain in the ass given the following:

  • Nginx built from source with pagespeed and brotli
  • MySQL.
  • Memcached and Redis.
  • Elasticsearch
  • Litespeed on a different port.
  • Netdata, Duplicati.
  • Certbot w/ cloudflare dns.
  • Docker with Bitwarden-rs, Nextcloud, Plex, and mariadb.

As you can imagine it’s a lot of work to reinstall everything, reconfigure it all, and avoid downtime.

I’ve tried the following for rsync:

rsync -auHxv --numeric-ids --exclude=/etc/sysconfig/network-scripts/* --exclude=/etc/systemd/network/* --exclude=/root --exclude=/etc/netplan/* --exclude=/swapfile --exclude=/etc/fstab --exclude=/etc/network/* --exclude=/proc/* --exclude=/var/cache/netdata/* --exclude=/tmp/* --exclude=/sys/* --exclude=/dev/* --exclude=/mnt/* --exclude=/boot/* --exclude=/home/* root@OLDSERVERIP:/* /

This results in no ssh access (timeout) and no response through IP after a reboot, but a console launched from the provider panel does work and some services are indeed running (mysql, litespeed, etc).

Is there a better way around this?

Make a disk image.

1 Like

Would that work? I’m moving from a dedi to an OVZ7 box.

cat /dev/xvda | gzip >/mnt/myshit.raw.gz

zcat /mnt/myshit.raw.gz >/dev/xvda

adjust the partition name, and give it a try

1st line on source system, 2nd line on destination after copying myshit.raw.gz to it

1 Like

All went to hell - I broke it :stuck_out_tongue:
Rebuilding…

5 Likes

did you adjust the partition name ?

How many resource you need to run all those stuff?
especially Plex?

OVZ is the wrong choice, esp. if you compiled your own stuff. simply because it relies on the hosts kernel and more…

if you still want to try and sync it, first bring your containers OS as close as possible to what you run actually on your dedi in terms of base system/software. make sure you have the header/dev packages for the kernel running on the target installed.

then rsync everything into a temp-dir and start replacing dirs like etc, home, root, usr and var afterwards using mv (like ‘mv /usr /usr.bak && mv /sync/usr /usr’ etc.) , but probably not /lib, maybe copy things into that one …

good luck.

2 Likes

I needed quite a bit of RAM, and it was the only thing within budget. So I’m stuck with that.
I’ll try to do the move as you suggested, if things fall apart I’ll just rebuild from scratch as usual.

Yea, put it into a VM, and snapshot it.

Update: manual move worked out, copied /etc/ and /var/lib/ of the software after installation one by one, fixed permissions here and there and tada.

Only issue was getting docker to work (needed a ticket and some fumbling) - and that Plex won’t work because I can’t use Plexdrive (needs fuse - will probably check if possible through ticket).

EDIT: as I say that they replied and enabled fuse. Props to AlphaVPS.

Thanks guys!

3 Likes