OH2 - upgrade of today

All,

I did an apt-get update / upgrade yesterday and it obviously deleted all the installed bindings and addons.
I needed to install bindings, persistence, etc. again (OH2 offline installation based on openhabian).
Additionally OH forgot the default persistence and other settings like simple mode for items.

The configuration ((rules, scripts, items and sitemap files) was still present and the system was up an running after adding the bindings and stufff.

Did anyone experience the same?
I am running the build 550 and the timestamp of the upgrade was someting like 20161021… at 12:xx o’clock.

Yes, the same happened to me. Openhab2 is not starting. I cannot get to the UI to configure anything.

Hey guys. Doing an upgrade right now… (starting at build #547)

As Kai told me, you have to add your bindings to the addons.cfg file. Then they are automatically installed while upgrading.

Upgrade went though (build #555) without problems.
That’s however due to the fact, that I am not using PaperUI but addons.cfg to install bindings. A step I can recommend to everyone…

@ThomDietrich
Thanks. I wasn’t aware of this, because up to now the upgrades did not require new installation of the bindings and stuff.
I will change the config files accordingly to be prepared for the next upgrade.

I would like to know if this “new behavior” (loss of bindings and some settings with apt-get update/upgrade, when installation was done with PaperUI) will be standard from now on when performing updates?! Or is this a known issue and will (hopefully) be resolved soon. @Kai, @ThomDietrich?

If it will be standard, we have to adapt our installations accordingly, e. g. like ThomDietrich suggested.

Thanks!

1 Like

Does this work for legacy 1.x bindings too?

No is the short answer…

installation through addons.cfg? Sure thing.

My config as an example:

binding = astro,homematic,sonos,xbmc,exec,mqtt,network,ntp,samsungtv

I think legacy bindingy are only installes by addons.cfg if also legacy “mode” is enabled … and therfore must also be added to a config file

oooh you are right. I’m sorry for that.

On order to add legacy 1.x bindings through configuration files, this is how your /etc/openhab2/services/addons.cfg could look like (with examples):

# The base installation package of this openHAB instance
# Valid options:
#   - minimal  : Installation only with dashboard, but no UIs or other addons
#   - standard : Typical installation with all standards UIs
#   - demo     : A demo setup which includes UIs, a few bindings, config files etc.
package = standard


# Access Remote Add-on Repositories
# Defines whether the remote openHAB add-on repository should be used for browsing and installing add-ons.
# This not only makes latest snapshots of add-ons available, it is also required for the installation of
# any legacy 1.x add-on and all experimental features. (default is false for offline distro, true for online distro)
#
remote = true

# Include legacy 1.x bindings. If set to true, it also allows the installation of 1.x bindings for which there is 
# already a 2.x version available (requires remote repo access, see above). (default is false)
#
legacy = true

# Include experimental add-ons. If set to true, it also allows the installation of extensions that are not (yet) part
# of the official distribution and need further testing (requires remote repo access, see above). (default is false)
#
#experimental = true

# A comma-separated list of bindings to install (e.g. "sonos,knx,zwave")
binding = astro,homematic,sonos,xbmc,exec,mqtt,network,ntp,samsungtv

# A comma-separated list of UIs to install (e.g. "basic,paper")
ui = 

# A comma-separated list of persistence services to install (e.g. "rrd4j,jpa")
persistence = influxdb

# A comma-separated list of actions to install (e.g. "mail,pushover")
action = pushover,xbmc

# A comma-separated list of transformation services to install (e.g. "map,jsonpath")
transformation = map

# A comma-separated list of text-to-speech engines to install (e.g. "marytts,freetts")
tts = 

# A comma-separated list of miscellaneous services to install (e.g. "myopenhab")
misc = 

Please be aware, that your configuration might lack parts of the shown options. In this case, please just add them from here!

Which addons are there, how are they called? In the offline installation you can check the content of /usr/share/openhab2/runtime/system/org/openhab/binding (replace “binding” by ui or whatever you need):

[17:28:37] pi@openHABianPiW66a:~$ ll /usr/share/openhab2/runtime/system/org/openhab/binding
total 412K
drwxrwxr-x 103 openhab openhab 4.0K Oct 29 15:47 ./
drwxrwxr-x  12 openhab openhab 4.0K Oct 29 15:47 ../
drwxrwxr-x   3 openhab openhab 4.0K Oct 29 15:47 org.openhab.binding.alarmdecoder/
drwxrwxr-x   3 openhab openhab 4.0K Oct 29 15:47 org.openhab.binding.amazondashbutton/
drwxrwxr-x   3 openhab openhab 4.0K Oct 29 15:47 org.openhab.binding.anel/
drwxrwxr-x   3 openhab openhab 4.0K Oct 29 15:47 org.openhab.binding.astro/
drwxrwxr-x   3 openhab openhab 4.0K Oct 29 15:47 org.openhab.binding.autelis/
drwxrwxr-x   3 openhab openhab 4.0K Oct 29 15:47 org.openhab.binding.avmfritz/
...
...

Ah, thanks Thom, the addons.cfg file I have doesn’t have the remote, legacy or experimental options.

How do you specify a legacy binding where there is a an OH 2 binding too - e.g. astro, squeezebox etc, do you specify the version, like this?

# A comma-separated list of bindings to install (e.g. "sonos,knx,zwave")
#binding = astro-1.9.0,http-1.9.0,mios-1.9.0,modbus-1.9.0,mqtt-1.9.0

Given the questions and issues (other threads I’ve been reading) with upgrading using apt-get, is there an alternative/prefered/suggested way of upgrading?

Thanks
James

Replying to my own post.

I went with a clean install of OH2 (snapshot, online), and then added the bindings in addons.cfg:

binding = astro1,http,mios,modbus,mqtt,networkhealth,weather

Note: the clean install version of addons.cfg didn’t contain the fields remote, legacy or experimental, so I added them too.

How do I install those bindings which are 1.x legacy bindings, but don’t in either the Paper UI or the karaf console - for example the squeezebox binding, while there’s a 2.0 binding, I want to get OH2 working with my current setup, I’ll migrate to the 2.0 binding in due course. Initially, I copied over the bindings manually, but they were removed on the last upgrade. Or where they have the same name:

openhab> feature:list | grep milight
openhab-binding-milight                   | 2.0.0.SNAPSHOT   |          | Uninstalled | openhab-aggregate-xml                | Milight Binding
openhab-binding-milight                   | 1.9.0.SNAPSHOT   |          | Uninstalled | openhab-aggregate-xml                | Milight Binding

Thanks
James

@Kai there was a PR for that once. Do you know what happened?

Regarding the installation of a special binding version: the easiest way would be to put your wanted addon file in the folder usr/share/openhab2/addons. I do not have personal experience with that as I always used the latest versions. You should too :wink:

I would claim that these fields are in there in any snapshot distro since June 27: added further config options (#240) · openhab/openhab-distro@e5782cd · GitHub

That’s what I thought too, just didn’t find the right commit.
@james_2_roberts either you carried your configuration from an earlier date with you or you are on an old OH2 version (in this case you should consider upgrading)

I’m not able to access my setup right now. I followed the instructions on the doc’s site to set up the repositories for access to the snapshot build and have installed the online version.
http://docs.openhab.org/installation/linux.html#package-repository-installation

After the apt-get upgrade at the weekend left things not working (which I now believe is due to stuff being deleted as part of the upgrade), I carried out the following steps:

apt-get purge openhab2-online

Checked all directories (I know about, particularly configs) had been deleted; they had. then:

apt-get install openhab2-online

If I’ve carried over an old configuration, how would I know - what didn’t I delete/remove, or how might I be managing an old version?

Thanks
James

@james_2_roberts I just realized that the problem is not on your end but related to apt. Don’t worry about it for now and just extend your addons.cfg with what you can find here: https://github.com/openhab/openhab-distro/blob/master/distributions/distribution-resources/src/main/resources/conf/services/addons.cfg

Thanks Thom,

I’ve made those changes and got some of the bindings now installed as a result.

Cheers
James