Migrate NethServer to another NethServer with rsync

This is still “Work in progress…”.

This HowTo is intended for people who need to migrate their NethServer - and the “easy” ways like Backup/Restore, Hotsync are not usable / practical in the specific use cases…

Some examples of use cases:

  • Migrating from different platforms, eg Physical 2 Virtual
  • Changes needed in Storage size, specifically a reduction is used diskspace. Enlarging is usually much easier, especially if running on virtual environments.
  • Changing the environment / parts therof like AD.

Assumptions / Presumptions

Migrating an old Version to the latest and greatest is not very practical, as differences in libraries may not be solveable, due to non-availability of certain versions or whatever.
Seen from this vantage point, it makes sense to update the source server to the latest version 7.9 if possible.

The plan is on the target, whatever it may be, is to install a similiar or identical NethServer, as close as possible to what’s needed / required…
Hardware does not matter, nor does it matter if installing on a Hypervisor like Proxmox, VMWare ESXi, Microsofts Hyper-V, Xen/NG or even VirtualBox.
I’m just assuming a correct, working installation, basic, but working!

→ This HowTo is not intended to cover a basic installation of NethServer on whatever environment or hardware, there are other HowTos for these cases…

I’ll use the terms Source-Server and Target-Server to refer to the two servers here.

Short task list:

  • Update the Source-Server
  • Install the new Target-Server
  • Update the new Target-Server
  • Make sure both servers can connect using SSH. How, eg using a LAN wiring or VPN is up to you and your situation.

Now comes the difficult part: deciding what to migrate…

This is still “Work in progress…”.

6 Likes

Interesting :slight_smile:
Two times action first :

  • Rsync the repository list to the new host
  • Rsync /var/lib/nethserver to the new host
  • Rsync the include path of backup (files and folder)
    to the new host
  • Dump the sql database to the new host (more difficult)

Then on the new host

  • Install the same rpm list to the new host

Eventually

  • Trigger the magic action to reconfigure the server

A nice script can be done I suppose

The hotsync actions should be done I think https://github.com/NethServer/nethserver-hotsync/tree/master/root/etc/hotsync.d

2 Likes

Salut @stephdl

This is one of the more difficult cases:

  • I need a new AD, as the old server will keep on running as home server, running less services. And both servers will be connected.
  • I need to MASSIVELY reduce disk space: 750 GB → 200-300 GB…
  • As old and new systems were installed and are running on Proxmox, all hardware (except for disk size and CPU / RAM size are the same, I do not need to worry about hardware or drivers.
  • On this box, there are probably a lot of old, “legacy” stuff, this box is one that came from SME-Server. So a new, clean install is the best way.
  • Besides which: Doing your commands would be more or less the same the backup / restore procedure does, I’d be left with a restore of the old server, using the same disk-space. It’s true that I could clean up the restore, but having 750 GB outgoing from a home residential Internet connection will take ages (about 3-4 weeks)…

At the moment, I’m still transfering / cleaning subfolders of /var/lib/nethserver/ibay/daten/Daten/… :slight_smile:

As this example shows, I’ve had to do this from a “dead” server. The RAID controller was dead due to a power outage during a storm. The Board would not boot correctly even from a single disk.
However, the second RAID disk seemed intact, but had no working boot-sector…
So had to attach the disk to another linux box (Notebook via USB adapter):

rsync -avzu -e ssh --delete /mnt/old-b/etc/ root@192.168.209.20:/AAB/etc/
rsync -avzu -e ssh --delete /mnt/old-b/root/ root@192.168.209.20:/AAB/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/

This actually worked!

The new NethServer was a VM on Proxmox, the old NethServer was a native install on an old, small HP Proliant server.

It’s not always “One size fits all…” in life.

:slight_smile:

My 2 cents
Andy

1 Like

Sure you can choose what to restore manually but a script won’t do it