Migrate NS7.9 to another NS7.9?

NethServer Version: 7.9

I need to migrate all the data, mails, … to another Nethserver 7.9, what is the best practice to do it?

I configured the new Server, users, ibays…

I reflect to use rsync to sync everything to the new location… but I am a bit concerned to overwrite files especially Mailfolders…

@fausp

Hi

You CAN use rsync to migrate a NethServer to another - I’ve done that before several times…
(Too large VM Disk, when still using ESXi…).

But you need to be very careful.
Certain Folders should NOT be rsynched (eg /dev, /boot), also certain hardware files in /etc need to be omitted…
(I sync the whole /etc to /AAA/etc AND make a copy of /etc to /AAA/etc-orig just to be safe, and migrate the stuff by hand there…). Same goes for /root…
All other stuff like mail folders are actually uncritical!
Just make sure you get the rsync direction correct!

It might be easier to try using Backup / Restore or Hotsync…

My 2 cents
Andy

PS:
Some notes from my last migration, a P2V for a friends home NethServer…

rsync -avzu -e ssh --delete /mnt/old-b/etc/ root@192.168.209.20:/AAA/etc/
rsync -avzu -e ssh --delete /mnt/old-b/root/ root@192.168.209.20:/AAA/root/
rsync -avzu -e ssh --delete /mnt/old-b/usr/ root@192.168.209.20:/usr/
rsync -avzu -e ssh --delete /mnt/old-b/srv/ root@192.168.209.20:/srv/
rsync -avzu -e ssh --delete /mnt/old-b/sys/ root@192.168.209.20:/sys/
rsync -avzu -e ssh /mnt/old-b/var/ root@192.168.209.20:/var/
rsync -avzu -e ssh --delete /mnt/old-b/var/lib/pgsql/ root@192.168.209.20:/var/lib/pgsql/
rsync -avzu -e ssh --delete /mnt/old-b/var/lib/mysql/ root@192.168.209.20:/var/lib/mysql/
rsync -avzu -e ssh --delete /mnt/old-b/var/www/ root@192.168.209.20:/var/www/
rsync -avzu -e ssh --delete /mnt/old-b/usr/share/zabbix/ root@192.168.209.20:/usr/share/zabbix/

Here the server was dead (Power Outage during vacation, no UPS), but the disk was still working…

Hi Andy,

Also when it is another domainname?

@fausp

Keep everything the same for starters, renaming the box is another issue…

Depending if you’re using AD, that might even be impossible the easy way… :frowning:

This way, all is migrated 1:1, and you can verify all is working (isolated networks…) - then move on to the next task, renaming the box!
But now, you still have the old box as a working reserve… :slight_smile:

Ready for the first test with:

#!/bin/sh

## ibays ##
rsync -avzr -e "ssh -p portnumber" --delete --progress --chown=username@domain:group@domain /var/lib/nethserver/ibay/IBAY-1/ root@targetip:/var/lib/nethserver/ibay/IBAY-1/
rsync -avzr -e "ssh -p portnumber" --delete --progress --chown=username@domain:group@domain /var/lib/nethserver/ibay/IBAY-2/ root@targetip:/var/lib/nethserver/ibay/IBAY-2/
rsync -avzr -e "ssh -p portnumber" --delete --progress --chown=username@domain:group@domain /var/lib/nethserver/ibay/IBAY-3/ root@targetip:/var/lib/nethserver/ibay/IBAY-3/

## home ##
rsync -avzr -e "ssh -p portnumber" --delete --progress --chown=username-1@domain:group@domain:domain users@domain /var/lib/nethserver/home/username-1/ root@targetip:/var/lib/nethserver/home/username-1/
rsync -avzr -e "ssh -p portnumber" --delete --progress --chown=username-2@domain:group@domain:domain users@domain /var/lib/nethserver/home/username-2/ root@targetip:/var/lib/nethserver/home/username-2/

## mails ##
rsync -avzr -e "ssh -p portnumber" --delete --progress --chown=vmail:vmail /var/lib/nethserver/vmail/username-1@domain/Maildir/ root@targetip:/var/lib/nethserver/vmail/musername-1@domain/Maildir/
rsync -avzr -e "ssh -p portnumber" --delete --progress --chown=vmail:vmail /var/lib/nethserver/vmail/username-1@domain/Maildir/ root@targetip:/var/lib/nethserver/vmail/username-2@domain/Maildir/

exit 0

Good Luck & no typos!!!

Andy

1 Like