Upgrade docker installation from 3.0.2 to 3.1.0

Last weekend I upgraded my openhab container from 3.0.2 to 3.1.0 running on a Synology Rackstation RS2414RP+.

I followed the procedure mentioned here:
Docker | openHAB

But openhab war started and about 2 seconds later stopped.
I tried to start the container several times without success.

After a lot of investigation I found the reason and a workaround for my problems.

In the log I found these lines:

+ backup_file=userdata-2021-07-11T09-39-20.tar
+ '[' '!' -d /openhab/userdata/backup ']'
+ mkdir /openhab/userdata/backup
+ tar --exclude=/openhab/userdata/backup -c -f /openhab/userdata/backup/userdata-2021-07-11T09-39-20.tar /openhab/userdata
tar: Removing leading `/' from member names
+ echo 'You can find backup of userdata in /openhab/userdata/backup/userdata-2021-07-11T09-39-20.tar'
+ tee -a /openhab/userdata/logs/update.log
You can find backup of userdata in /openhab/userdata/backup/userdata-2021-07-11T09-39-20.tar
+ exec /openhab/runtime/bin/update
+ tee -a /openhab/userdata/logs/update.log

################################################
          openHAB Docker update script
################################################

You are already on openHAB 3.0.2

Also with the new image the upgrde cecked against 3.0.2.
So the upgrade script is skipped and openhab stoped working.

The workaround was to fake the version in the file “userdata/etc/version.properties” to e.g. 3.0.1.
After that, the upgrade script was executed and openhab was running without problems and in version 3.1.0

Here an extract from the log after I faked the version number to 3.0.1:

+ backup_file=userdata-2021-07-11T09-42-19.tar
+ '[' '!' -d /openhab/userdata/backup ']'
+ tar --exclude=/openhab/userdata/backup -c -f /openhab/userdata/backup/userdata-2021-07-11T09-42-19.tar /openhab/userdata
tar: Removing leading `/' from member names
+ echo 'You can find backup of userdata in /openhab/userdata/backup/userdata-2021-07-11T09-42-19.tar'
+ tee -a /openhab/userdata/logs/update.log
You can find backup of userdata in /openhab/userdata/backup/userdata-2021-07-11T09-42-19.tar
+ tee -a /openhab/userdata/logs/update.log
+ exec /openhab/runtime/bin/update

################################################
          openHAB Docker update script
################################################

The script will attempt to update openHAB to version 3.0.2
Please read the following notes and warnings:

Important notes for version 3.1.0:
  Warning:  Xiaomi MiIo Binding: Many channels have been converted from Number to a Number with dimension, e.g. temperature channels have been changed from Number to Number:Temperature. Please see the binding documentation for details.
  Warning:  Keba Binding: Introduced Units of Measurements and the channel 'pwmpilotcurrent' was replaced by 'maxpilotcurrentdutycyle'. Items must be adapted and things created through the UI must be recreated.
  Warning:  Nest Binding: The binding now also supports the SDM API. To keep using the WWN API, add the 'wwn_' prefix to Thing Types in files or recreate the WWN Nest Things using the UI with your current WWN account configuration parameters.

Replacing userdata system files with newer versions...
Clearing cache...


SUCCESS: openHAB updated from 3.0.1 to 3.0.2

Has anybody else the same problem?

I didn’t check the logs, but I may have had the same issue. I solved it by deleting the container and downloading/installing the “latest” image.

Did you report the problem at github? I had the same issue with updating from 3.1.0 to 3.2.0.

Apparently this is a portainer bug. Upgrade script fails for new image · Issue #379 · openhab/openhab-docker · GitHub

Workaround is described here GitHub - openhab/openhab-docker: Repository for building Docker containers for openHAB