[SOLVED] OH3 persistence does not work (anymore) -> Analysis

Initially when I had installed OH3 the persistence of data worked.

I recently installed mapdb to make sure Items like strings are restored on startup.

It seems that since then the persistence of the normal items for the ANALYSIS in the Main UI doesn’t work anymore.

These two bundles are installed
image

Default persistence is

image

I changed this half an hour ago to rrd4j but it didn’t help (does mapdb now still work for startup management?)

The settings are

mapdb.persist

Strategies {
    default = everyUpdate
}

Items {
    plannedTime* : strategy = everyUpdate, restoreOnStartup
    settings*: strategy = everyUpdate,  restoreOnStartup
}

rrd4j.persist

Strategies {
// for rrd charts, we need a cron strategy
   everyMinute : "0 * * * * ?"
   default = everyChange
}

Items {
        * : strategy = everyUpdate, everyMinute, restoreOnStartup
}

Any idea what could be wrong?

1 Like

Mine works fine and I think it could be because you have 2 restore on startup. That also cause me problems.

My mapdb.persist looks like this:

Strategies {
        default = everyChange, restoreOnStartup 
}

Items {
        // persist all items on every change and restore them from the db at startup
        * : strategy = everyChange, restoreOnStartup ,everyUpdate
}

My rdd4j.persist looks like this:

Strategies {
        default = everyChange
}

Items {
        // persist all items on every change and restore them from the db at startup from mapdb
        * : strategy = everyChange, everyUpdate
}

Good luck. I am using OH3 by the way.

1 Like

if i am not mistaken, you don’t need a persist config file in the first place for your default service if you anyway want to persist everything. I have also both persist services running and the rrd4j my default with no config file, with the MapDB if have persisted some items only configured in the file for other purposes. You can try delete your rrd4j config file and see if this works with you

1 Like

Thanks Greg and Jan for the very fast response,

Comparing our files it seems that the files should be ok on my side. So I finally dared to “restoreonstartup” :wink: openhab (usually I hesitate doing that on my production device) like in the old saying “didyouturnitonandoffagain?” which I should have done before.

now it works…

The hint on having two restoreonstartups though is a good one when I think about it because it would mean that any of the two “wins” which could be an issue. So I removed that option from the rrd4j.

For those who are reading along who wonder why I use two persistence implementations:

RestoreOnStartup is recommended to do with mapdb as it only uses ONE entry for an item but even more important: other persistence implementations like rrd4j for example do not support “string” to be persisted.

That’s why I use both persists as well.
I probably could remove the rrd4j.persist file but it is working for me as it is now.

1 Like