How can I upgrade a feature?

Hello all,

I’m always in charge with upgrading packages.
At the moment I do bundle:upgrade but this might cause inconsitencies.
So I’ve tried to to things like:

feature:repo-add mvn:org.openhab.addons.features.karaf/openhab-binding-zigbee/3.1.1/xml/features 3.1.1

Here my first question, can I add here a name for the repo because currently only “feature” is displayed.

And then the second quesiton, if I want to upgrade this plugin to the latest Snapshot with a similar syntactic or to a Milestone I get an error:

openhab> feature:repo-add mvn:org.openhab.addons.features.karaf/openhab-binding-zigbee/3.2.0M5/xml/features 3.2.0M5
Adding feature url mvn:org.openhab.addons.features.karaf/openhab-binding-zigbee/3.2.0M5/xml/features
Error executing command: Error resolving artifact org.openhab.addons.features.karaf:openhab-binding-zigbee:xml:features:3.2.0M5: [Could not find artifact org.openhab.addons.features.karaf:openhab-binding-zigbee:xml:features:3.2.0M5 in openhab (https://openhab.jfrog.io/openhab/libs-release/)] : mvn:org.openhab.addons.features.karaf/openhab-binding-zigbee/3.2.0M5/xml/features
openhab> feature:repo-add mvn:org.openhab.addons.features.karaf/openhab-binding-zigbee/3.2.0-SNAPSHOT/xml/features 3.2.0-SNAPSHOT
Adding feature url mvn:org.openhab.addons.features.karaf/openhab-binding-zigbee/3.2.0-SNAPSHOT/xml/features
Error executing command: Error resolving artifact org.openhab.addons.features.karaf:openhab-binding-zigbee:xml:features:3.2.0-SNAPSHOT: [Could not find artifact org.openhab.addons.features.karaf:openhab-binding-zigbee:xml:features:3.2.0-SNAPSHOT] : mvn:org.openhab.addons.features.karaf/openhab-binding-zigbee/3.2.0-SNAPSHOT/xml/features

And my last question, is there an easier way to upgrade a whole feature like providing the URL of the .kar file and that’s it.

Thanks a lot
/Franz

openHAB is distributed as a whole package. It’s more than just the OSGi bundles that need to be updated. There are config files that might need to be changed and other stuff that a upgrade script needs to change outside of Karaf. For example, the patches that were just released to mitigate the log4j2 vulnerability would not be picked up when you upgrade in this way.

If you’ve installed using apt/yum, a typical approach is to use those tools to update/upgrade. If you’ve manually installed, you’d download the full distribution and unzip it over your current install (after backups of course) and run the upgrade.sh/bat script.

I’ve never heard of anyone attempting to update piecemeal like this and have no expectation that it would work.

Hi Rich,

thanks for the quick reply.
Usually I throw out the Docker Image and load a new one => Easy.
But if for example a bug in one feature is detected. (Means in case of Zigbee ~10 Modules to update to be consistent) then I would prefer to do it with a feature update.

BR
/Franz

In that case the documented approach is to remove the binding, download the updated jar file and place it into OH’s add-ons folder. OH will see that and install it.

However, there is no guarantee that this will work. Often non-user facing breaking changes occur in OH core which makes newer versions of bindings no longer compatible with older versions of OH core. That’s one reason why core and add-ons are all labeled with the same versions and managed as a whole package instead of piecemeal.

It’s often more reliable to just update the whole thing to the newer version, especially if there has been a lot of time between the two versions . But of course YMMV based on which add-ons you have installed.

Hi Rich,

thanks for the details.
The only thing is that i could not found a stable version so far.
From today on I’ll give 3.2.0-RC1 a try.
Removing the Binding and add (not sure of kar or jars) is not really an option. I guess this would mean to learn again 20 ZigBee devices.

BR
/Franz

No, the devices are stored on the controller. And removing the binding does not remove the Things. So you can remove the binding, drop the jar into addons and it will pick up the old Things.

The only time you need to recreate the Things is if something changed in the binding that breaks the Things but that is usually announced.

Thanks Rich

This information was really valuable, next time I give it a try.

BR
/Franz