Restore of mapdb persisted values with openhab-cli backup/restore does not work with OH3

Dear all

I’m trying to get OH3 under my control as a on professional. One of the issues is the following: I wanted to restore my mapdb persisted values after migration since they got lost after migration from OH2.5 to OH3. Unfortunately it did not work, so I gave up on this one.

However, that at least with OH3 I can restore persisted values in case of a crash or whatsoever, I wanted to make sure that with openhab-cli backup/restore I can restore my persisted values .So I backed up and tried to restore immediately thereafter. And the funny thing is that even that does not work. I get loads of error messages like this:

10:24:39.961 [ERROR] [rnal.common.AbstractInvocationHandler] - An error occurred while calling method ‘QueryablePersistenceService.query()’ on ‘org.openhab.persistence.mapdb.internal.MapDbPersistenceService@1602f62’: null
java.lang.NullPointerException: null
at org.openhab.persistence.mapdb.internal.MapDbPersistenceService.query(MapDbPersistenceService.java:195) ~[?:?]
at jdk.internal.reflect.GeneratedMethodAccessor48.invoke(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:834) [?:?]

So, I’m quite helpless on this one too. Does anybody has an idea what is wrong here?

Latest observation: Since I tried to “test-restore” the system (see my first post), the mapdb service is broken. I tried to uninstall and reinstall it, I cannot get it work again :unamused:. So, whenever I reboot the system all “persisted” values are lost… this is quite painful at the moment…

  • in case with regard to mapdb you start from scratch and you do a reboot it does not work ?
  • do you use ZRAM ?
  • backup / restore was done when service openhab was in stopped status ?

Thank you Wolfgang for the reply. regarding your points:

  1. yes
  2. no
  3. backup with a script (openhab is running), restore via: openhabian config tool (I guess it will stop openhab service)

By the time I tried to restore with an older backup and mapdb is running again. Now, I don’t dare to do the experiment of backing up and restoring (as described at the beginning) to test if my persisted values get restored. I fear the hassle of getting the thing to work again too much in case it will be broken again. However, it does not leave me with the best feeling, since I don’t know if I really can restore persisted values in case of a crash

ZRAM - no
Are you sure? openhabian does it by default I think. It makes exactly how OH is closed down important.

Hi Rossko57,

No i‘m not sure, I just did not install it myself - how can i check if it is installed?

I think the software is installed in directory /opt/zram.
As far as I remember you can run the command

mount

and in case it is used you should see a mount entry of/for zram.

1 Like

I checked the backup and restore script. I did not find any entry that stops openhab before taking a backup. In restore script there is a message that openhab needs to be taken donw before restoring.

Hi Wolfgang

I was brave today and tried my experiment of backing up and restoring again. Now it worked, the mapdb persisted values got restored. I guess I messed up something during my OH3 configuration, where I mistakenly thought It was an issue of the mapdb. Thank you in any case for your efforts, i highly appreciate it.

So, for me there is one issue left with OH3 (or more precisely with a binding), where I have no clue how to resolve it. It is the persistence on a mariaDB database on my synology with JDBC:

https://community.openhab.org/t/jdbc-mysql-persistence-in-oh3/109922/51?u=logos.

In any case thank all for your help