Upgrade from 2.0.0 to 2.1.0

Right, I need some help - I have gotten myself totally in a mix.

I originally ran a manual install, but later replaced this with an apt-get install using:
Please note I am not a linux guy, so I am largely poking this beast with a stick for reactions.

A repo list using apt returns these installs:

openhab2/unstable 2.1.0~20170212123642-1 all
openhab2-addons/unstable 2.1.0~20170212123642-1 all
openhab2-addons-legacy/unstable 2.1.0~20170212123642-1 all
openhab2-online/now 2.0.0~20170108170225-1 all [installed,local]

So this appears to be an apt-get install.

Now according to
Backing/Restoring up openHAB2.x , my userdata and conf are at:
/var/lib/openhab2/ and /etc/openhab2/ - which they appear to be (in fact, I have been editing the conf text files and they are having the desired effect)

Which means I should have the details required to follow:

When I look at this though - it tells me:

If you’re using a version earlier than 2.1.0, then you can use the following commands in Terminal to download the script and run it. Assuming the openHAB directory is in /opt/openhab:

Of course - I don’t have anything in /opt
In fact: http://docs.openhab.org/installation/linux.html#file-locations tells me my repo install installation path should be /usr/share/openhab2 (again this appears correct)

Now here’s the winner . .

If I try follow the upgrade script mentioned above http://docs.openhab.org/installation/linux.html#upgrade and I replace the incorrect path (/opt/openhab) with what should be the valid path (user/share/openhab2) the script STILL fails to run

blah@openHab2:/$ cd /usr/share/openhab2/
blah@openHab2:/usr/share/openhab2$ ls
addons  bin  LICENSE.TXT  runtime  start_debug.sh  start.sh
blah@openHab2:/usr/share/openhab2$ sudo sh -c "$(curl -fsSL https://raw.githubusercontent.com/openhab/openhab-distro/master/distributions/openhab/src/main/resources/bin/update)" -- 2.1.0
[sudo] password for blah:

       openHAB 2.x.x update script

The script must be called from openHAB's root directory.
Either specify a directory or place this update script in and run from openHAB's root folder.

Now - cracking open the script, I learn that the script is looking for the folders userdata and conf in the current directory - in order to determine that this is in fact a valid openhab root directory.

I’d like to just get to the point where I can upgrade via the script, since I keep coming accross nasties and the solution always seems to be “the nightly release fixed this issue”

Please could someone point me in the right direction - as you can see above, I have spent a fair chunk of time trying to figure this one out

1 Like

Alrighty, I think we’ll need to straighten a few things out first. Hopefully I can help here! :slight_smile:

From the information you provided I can say:

  1. You’re currently reading from an old repository.
  2. It looks as though you’re using the snapshot version of 2.0.0, which is older than the official release of 2.0.0
  3. You are indeed on an automatic install, but are reading the update instructions for the manual process.

Let’s sort these out in order, as always I’d recommend taking a backup first and check the change log for 2.1.0 and any change that affects you

1. Switching to the latest repository.

The snapshot builds are available on a service called “Artifactory”, previously, they were on a service called Bintray. openHAB was told to move the snapshots, so anyone using Bintray needs to redirect to the new location. As mentioned in the installation docs, the commands to do this are:

wget -qO - 'https://bintray.com/user/downloadSubjectPublicKey?username=openhab' | sudo apt-key add -
sudo apt-get install apt-transport-https
echo 'deb https://openhab.jfrog.io/openhab/openhab-linuxpkg unstable main' | sudo tee /etc/apt/sources.list.d/openhab2.list

2. Upgrading to 2.2.0 Snapshots

The snapshots always follow the version number of the next unreleased version of openHAB, since 2.1.0 is released then the snapshots will be called “2.2.0~[TIMESTAMP]-1”.

On the version that you’re on, openHAB came in two packages called “openhab2-online” and “openhab2-offline”, the reason why it’s not updating at the moment is because the package is now just one thing called openhab2 where it’s trying to find the latest package called openhab2-online. To switch to this, just install openhab2 and the older package will be dealt with automatically:

sudo apt-get update
sudo apt-get install openhab2

3. Upgrading to the next nightly and so on

You’re all set! From now on, update openHAB just as you would any other Linux program:

sudo apt-get update
sudo apt-get upgrade

The update script only works for manual installations, hence why it’s not working for you.

Let me know how you get on! Good luck!


Legend Benjy,

Thanks - that worked a treat
As an added bonus, I created a backup script and also resolved my other issue (basic / classic ui not loading)

Thanks very much again!

1 Like

Awesome, glad to hear it! and that you’ve got a backup script going on top!! There’ll be backup and restore scripts included with openHAB in the future but these haven’t been tested and added yet. Always good to have a way of doing it now! :slight_smile:

Hmmm… a new problem.
It seems that my items have all disappeared from the PaperUI view (items field itself is missing)

I can see the items in my home.items fille, I can see them through the Rest Api.

Some items were created through the PaperUI interface - and these are still functioning OK - I can see them in the file: org.eclipse.smarthome.core.thing.link.ItemChannelLink.json

I can’t however see any of the items in PaperUI itself.

Hmm, any clue from the logs? I’m afraid I’m not sure what could be causing this. If you find anything, It might be better to start a new thread now that the original question is answered (not seeing the paper ui items won’t be caused by the update process as such, but might be a bug in a new version?) .