I’m trying to find docs for migrating my install from what is currently an apt-get based Ubuntu build onto openhabian.
I have already searched the community, but anything with ‘migrate’ in it returns the myriad of docs referring to migrating from OH 1 to OH 2.
If someone has a link or some guidance, please share (it’s a medium sized install - 14 bindings, around 85 devices - significantly more items)
I am ok with migration of the configuration files - it’s all the lost info stored in DB that was created through PaperUI that I am concerned about (Xiaomi Mi, Nest, Onkyo, Yamaha)
I am not too concerned about the persistence stuff (currently MySQL) as I’ll be moving to Grafana/InfluxDB
Assuming there is not a simple method - could I use the rest api and just get/set through all items?
You should copy the config files in /etc/openhab2/[services,items,things,rules]/*.
Plus you can copy the DB, it’s a single file: /var/lib/openhab2/jsondb/org.eclipse.smarthome.core.thing.Thing.json
There’s also a couple of environment related config in /var/lib/openhab2/etc/* that you might want to copy (such as logging config).
BTW, you can also install the openhabian scripts on top of Ubuntu.
That’s not quite right There are many different json files that need to be included if you want the settings to come along. If you’re using bindings like z-wave, then entire folders need to be restored also.
You can use the backup and restore scripts in $OPENHAB_RUNTIME to backup and restore everything config related (database and the files in /etc/openhab2). This works across any platfrom or hardware, as long as it can run openHAB2.
On apt based installations (such as Ubuntu, and openHABian), the shortcut for this is:
sudo openhab-cli backup
This will place file in /var/lib/openhab2/backups, copy this zipfile somewhere safe! Then once you’ve installed openhab2 (and Java 8) on the new machine, simply:
Really - which ones? I ran a backup and quickly glanced over the .zip but didn’t notice any others than the jsondb I mentioned… (yeah okay and its backups and those files that are created e.g. on discovery, but you don’t really need to backup those, applies to zwave files, too, they all can be dynamically recreated).
Either way, good to know you had a migration scenario in mind.
So @bulletprooffool yep don’t just copy what I mentioned but go with that backup script .