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…



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

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

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

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?


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:


## 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!!!


1 Like