Transfering OH2 to new hardware

Hi All,

I dont have much knowledge of linux but my OH2.4 has been great so far on a Cisco UCS blade with Ubuntu 18x.

I’m considering moving it into QNAP Virtulisation station, the QNAP has plenty of available CPU/Memory/Storage to run the VM to save on power and remove the UCS blade from production.

My / volume that OH2 runs on is about 11G and my /home is about 995MB.

Is it as simple as copying everything in these locations to their new locations on the QNAP to transfer everything over after a fresh install of OH2.4 on the VM?

There are numerous add ons and scripts and things like private instances of OH2 Cloud, NGINX configuration etc that all takes time to setup that I just want to move over.

I’m assuming its not like Windows and you can just copy everything across

Thanks!

I’m going to recommend searching the forum for QNAP first. There are lots of people who have a heck of a time running OH on QNAP. Usually the problem is with giving the VM access to the needed USB devices like Zwave controllers. If you are not using any of those you are probably all set.

I would not recommend just copying / from your blade to the GNAP VM. The biggest problem you will likely run into is incompatible device drivers. It CAN work theoretically but in the event that it doesn’t work, you’ll end up spending a whole lot more time than if you had just built the VM from scratch and moved over your configs in the first place.

So I would recommend:

  1. install the base OS
  2. install the various software you use
  3. move over the configurations for the various software. Where possible use the built in backup and restore scripts (e.g. openhab-cli backup, openhab-cli restore). Otherwise you will want to copy that program’s /etc folder over and that program’s /var/lib folder. Look into each one to see what their recommended procedure for moving to a new machine is.

This will be more reliable and probably take less time in the long run.

And if you think this will ever happen again, I’d recommend looking into Ansible and script all of this out. Then moving to new hardware or rebuilding your VM is as simple as running an Ansible playbook.

1 Like

Thanks Rich. I’ve installed the base OS, Zulu Java & OH2.

What took forever was setting up the private OH2 cloud, lets encrypt, nginx.

Could those be just copied over?

Unlike in Windows, on Debian based Linux distros parts of programs are scattered all over the place in the file system. Do you know where to look to just copy those programs over? Probably not. I don’t even know all the places to look for just openHAB (let’s see, there is /etc/openhab2 of course, /var/lib/openhab2, /usr/share/openhab2, a few files in /usr/bin/, maybe a file in /etc/default, /var/lib/systemd?, more?). These other programs will be the same.

But all the work you did setting them up is most likely just in /etc and any data generated by the program is stored in /var/lib. So install those programs using apt and then just copy over the configs and data. Search google for how to backup/restore or migrate to a new machine for each of those programs to make sure they are not doing something weird.

Thanks Rich, going to start making myself some notes and web links of HOWTOs for installing the various tools to ease in the migration over.

My System is stable but im preparing for the worst since I’m so reliant on it now for the functions of the house.