OH4 (OpenHABian) to OH5 (Docker) migration - Migrate rrd4j fails

Hi,

I would like to use the Docker based setup from now on. So far I have used an Openhabian based setup within a Proxmox LXC. I fail to migrate historical item values. All charts stay empty. They even stay empty when OH5 is running for couple of minutes and should have collected new values:

Some background infos:

My .envfile for docker:

USER_ID=999
GROUP_ID=995
OPENHAB_ADDONS=/opt/openhab/addons
OPENHAB_CONF=/opt/openhab/conf
OPENHAB_LOGDIR=/opt/openhab/userdata/logs
OPENHAB_USERDATA=/opt/openhab/userdata
EXTRA_JAVA_OPTS=“-Duser.timezone=Europe/Berlin -Duser.country=DE -Duser.language=de -Dorg.jupnp.network.useInterfaces=eth0@if66 -Dorg.jupnp.network.useAddresses=192.168.188.142”

The docker-compose.yml:

services:
  openhab:
    container_name: openhab
    image: openhab/openhab:5.0.1-debian
    restart: unless-stopped
    network_mode: host
    volumes:
      - /etc/localtime:/etc/localtime
      - /etc/timezone:/etc/timezone
      - $OPENHAB_CONF/ssh:/openhab/.ssh
      - $OPENHAB_ADDONS:/openhab/addons
      - $OPENHAB_CONF:/openhab/conf
      - $OPENHAB_USERDATA:/openhab/userdata
    environment:
      - EXTRA_JAVA_OPTS=${EXTRA_JAVA_OPTS}
      - CRYPTO_POLICY=unlimited
      - OPENHAB_HTTP_PORT=8080
      - OPENHAB_HTTPS_PORT=8443
      - USER_ID=${USER_ID}
      - GROUP_ID=${GROUP_ID}

 

The steps I did before starting the container:

  1. openhab-cli backup on my old OH4 setup
  2. Extracting the conffolder into /opt/openhab/conf
  3. Extracting persistencefolder into /opt/openhab/userdata

All files within /opt/openhab belong to openhab:openhabon the new system and the user openhab has UID/GID 999/995. The items and things appear and instantly everything seems to work. I can control lights etc. with the new system. It is only the missing historical values which is bothering me. Any hints?

OK, resolved it by myself. I used the restore-script which you can execute with Docker before the openHAB Service starts:

On the Docker host I created /opt/openhab/cont-init.d/restore.sh which contains one line:

echo y | /bin/bash /openhab/runtime/bin/restore /openhab/backups/backup.zip

The backup.zipwas created with a simplye openhab-cli backupon the source system. No --fullneeded. Then I mounted the backup file and the script into the container like this:

    volumes:
      (...)
      - $OPENHAB_MAIN/cont-init.d:/etc/cont-init.d
      - $OPENHAB_MAIN/backups:/openhab/backups

And then everything works like a charm. Finally. :wink: