Mapdb persist all items

I have upgraded to openHab 4 and am now using the UI for everything (no files)

I have noticed that mapdb won’t restore items unless they are specifically added to the configuration.

When I was running on openHab 3 I didn’t have to do this and everything restored on startup.

Is there a way to define every item to persist? I cannot see any such setting in the documents or forum.

I have added items to a mapdb group and have put that in the configuration and that works.


Somewhere along the way RRD4J became the default persistence and I believe the default setting is also for restore on startup (One of the forum experts can verify). The only issue is that it only deals with numbers and (ON/OFF) IIRC. Therefore, also added mapdb and put datetimes and images to restore on startup. So i’m mostly using RRD4J and only MapDB for a handful of items.

As far as I know rrd4j only does numbers.
I persist using rrd4j so the graphs work and I add the items in the configuration.
I used to just persist everything in openHab 3 with no special settings and it used to work.
Now I have to add all the items I wish to restore on startup.
I just wanted to know if there is a way to persist everything in mapdb without having to add all the items.

Probably something like this

Strategies {
default = everyChange
Items {
  //Date time items and camera images
    * : strategy = everyChange, restoreOnStartup

Yes that is something like I had when using the files but how do I do that in the UI.
If I put * it flags a syntax error on the UI configuration page?

Sorry can’t help there. I’m an old DSL text user.

I used to be DSL and files but have swapped totally to UI and javascript and don’t use sitemap at all anymore.
It is a bit easier and less prone to errors.

I think if I do this it might work:

  - items:
      - "*"
      - everyChange
      - restoreOnStartup
    filters: []
cronStrategies: []
defaultStrategies: []
thresholdFilters: []
timeFilters: []
equalsFilters: []
includeFilters: []

I think the changes I did above work.

The docs seem to imply the * should work
Persistence | openHAB

Edit: good

Thanks for that.
The examples on the documentation look like file examples but I have another openHab test system so I put the configuration in the persistence file and then went to the UI and copied the code to the real system and also turned on mapdb debug and it works.
It may do a lot more disk writes as it is storing everything so I may go back to just inclusing the items I want to restore. At least I know there is a way to do all items.

1 Like