|
Post by papa on Jan 13, 2020 17:40:24 GMT
Upgrade/Install openHAB using Backup Files
Previously, I had used text config files to install openHAB. Almost a year ago, as reported in the thread, Install OH 2.5.0.M1, MQTT 2, etc, I installed an upgraded version. I started fresh on a Windows 10 laptop. My goal was to install an (as current & as safe as possible) OpenHAB 2 version with the 2.xx bindings of NTP, Network, & MQTT AND if possible the new embedded MQTT message broker. In the early stages of that install, I used PaperUI & was successful Now I wanted to try installing the latest stable version of openHAB using backup data not only from openHAB's \conf folder but also from \userdata\jsondb where Things & channels are stored. In preparation, I saved a copy of all files in openHAB's \conf folder & \userdata\jsondb folders. In openHAB's \runtime\bin folder are backup scripts (which may have saved more data), but I did not use one of those. (More on this later.)
In the jsondb Thing file, openHAB 2 stores Things in alphabetical order, but channels are stored in the order in which they are created. As an experiment, I edited one Thing's channel into numeric order. After the new install, when I look at PaperUI/Configuration/Things, that Thing's channels were still in the order of their creation. Perhaps some other file controls order.
Update, Nov. 14. 2020: Although this thread's posts refer to earlier openHAB versions, I've successfully used this method for later versions, including openHAB 2.5.10 so far.
Next, Starting the New Install of openHAB 2.5.0
|
|
|
Post by papa on Jan 13, 2020 18:05:46 GMT
Starting the New Install of openHAB 2.5.0
This latest install was also on a Windows 10, 64 bit laptop. I removed an older version of Java. To satisfy the prerequisite, I downloaded & installed the latest version of Zulu Java, version 8 (build 25.232-b18 .msi). I edited the JAVA_HOME environment variable to contain the path to Java. I downloaded the latest openHAB 2.5.0 stable & unzipped its files into a C drive folder. Next into the new openHAB's \conf & \userdata\jsondb folders, I copied over the files I backed up from 2.5.0.M1. Initial Results of the New openHAB Install
|
|
|
Post by papa on Jan 13, 2020 18:55:42 GMT
Initial Results of the New openHAB InstallIn the jsondb Thing file, openHAB 2 stores Things in alphabetical order, but channels are stored in the order in which they are created. As an experiment, I edited one Thing's channel into numeric order. After the new install, when I look at PaperUI/Configuration/Things, that Thing's channels were still in the order of their creation. I hoped that some other file controls sort order & could be changed. However ... In this post, David_Graeff, Maintainer, Apr '19 wrote, "It doesn’t sort. It gets the results from openHAB core and presents them exactly like that. If the core stores Thing channels in a hashmap there is no obvious order to them."
For a short list of a Thing's channels that is inconvenient & annoying. For a long list, it could add much time & trouble trying to find a channel unless we carefully create channels in (mostly) numeric order.
Initial Results of the New openHAB Install, continued
|
|
|
Post by papa on Jan 14, 2020 16:02:04 GMT
Initial Results of the New openHAB Install, continued I ran openHAB's start.bat
In a browser, I opened the openHAB dashboard at http://127.0.0.1:8080
In the dashboard, I chose expert package (which provides several UI choices) & waited while openHAB booted in the background When I had the opportunity, I opened PaperUI.
Transformations were already listed in PaperUI. Things & channels were also listed, but as "not initialized." These addons were not installed: bindings, persistence, misc/mqtt broker, & misc/openHAB cloud
So far, how I used backed up openHAB files gave me a head start on an operational openHAB, but it was not complete.
Progressing on the openHAB Install
|
|
|
Post by papa on Jan 15, 2020 19:01:24 GMT
Progressing on the openHAB InstallAt PaperUI\Addons\Bindings, I entered NTP in the search box & for the NTP binding, clicked install. The icon spins, refresh shows NTP binding is installed, & the related Thing is now online.
At PaperUI\Addons\Bindings, I did the same with Network & OpenWeatherMap. I did not install the openHAB Cloud Connector so this openHAB did not interfere with my main install in another geographical location.
At PaperUI\Addons\Misc, I did the same with MQTT Broker Moquette & MQTT.
As a result, the Addons were all installed & related Things & channels were online.
At PaperUI\Configuration\System\Regional Settings, I clicked Show More. Under "Measurement System" I chose Imperial (US). I clicked Save in the lower right of the Regional Settings window. I believe I also stopped & restarted OpenHAB for the change to register.
With a moderate amount of extra steps, my openHAB was back in business.
Turns out most of what I did in this post was not necessary because of ...
A Better Way to Upgrade/Install openHAB using Backup Files
|
|
|
Post by papa on Jan 15, 2020 19:26:32 GMT
A Better Way to Upgrade/Install openHAB using Backup Files
As I wrote above, in openHAB's \runtime\bin folder are backup scripts. I ran backup.bat to create a zip file backup from a working openHAB install. As I expected, it included more files than what I saved on my own before. Though there is also a restore.bat script, I just copied files from the .zip backup to their indicated folder located in a fresh install of openHAB. I then started that openHAB install.
This worked very well. I immediately had an upgraded openHAB which included my chosen installs, Things, channels, etc.
The only thing that was still needed was setting the Imperial System of measurement as I did in the post just above.
Setting up openHAB via PaperUI requires much clicking & filling fields. However, once done, this can be easily copied into a new installation with the help of a provided backup script.
|
|
|
Post by papa on Jan 30, 2020 19:33:55 GMT
A New Install of openHAB 2.5.1 Using Backup Scripts & Files
Since an attempt at a virtual machine blew up my Windows 10 install on a testing laptop, I was reinstalling. This latest install was also on a Windows 10, 64 bit laptop. To satisfy the prerequisite, I downloaded & installed the latest version of Zulu Java, version 8 (8u242b20, Zulu: 8.44.0.11). I edited the JAVA_HOME environment variable to contain the path to Java (C:\Program Files\Zulu\zulu-8)
I created a folder for openHAB: C:\openHAB2.5.1 & the subfolder C:\openHAB2.5.1\backups
(There are linux script equivalents of the Windows .bat scripts used below.)
From a working openHAB 2.5.0.M1 install, I ran /runtime/bin/backup.bat & got a .zip of essential files. which I copied into C:\openHAB2.5.1\backups
I downloaded the latest openHAB 2.5.1 stable & from its .zip, copied folders/files into C:\openHAB2.5.1
In C:\openHAB2.5.1\runtime\bin I ran restore.bat The resulting folders & files look good.
Next, Initial Results of the Latest openHAB Install
|
|
|
Post by papa on Jan 30, 2020 20:09:49 GMT
Initial Results of the Latest openHAB Install I ran openHAB's start.bat In a browser, I opened the openHAB dashboard at http://127.0.0.1:8080 In the dashboard, I did not have to choose expert package. Via the backup, all expert package UIs were already displayed. I was able to open PaperUI much quicker than before PaperUI already listed Transformations, Bindings, & the embedded MQTT broker as installed.
Things & channels were also listed & ONLINE ! Channels were linked to items.
For the time being, I uninstalled openHAB Cloud Connector because this is a test computer now my main openHAB system that automates my home. So far, how I used backup AND RESTORE scripts gave me a quick start on an operational openHAB.
|
|