OH 5.0.0 SNAPSHOT - MapDB Persistence not restoring some items on startup

Hi All
Since changing from influxDB to MapDB for my Restore on Startup Persistence as suggested in

I have picked up that at least one of my ITEMS is no longer being restored

My setup is as follows:

  • Platform information:
    • OS: Windows 10/10.0 (amd64)
    • Java Runtime Environment: Eclipse Adoptium 21.0.6 (Temurin-21.0.6+7)
    • openHAB version: openHAB 5.0.0 Build #4546

I have not been able to find anything in the logs. There does not seem to be any logging related to Restore on Startup - I can see if I manually edit the item that it is logged etc.

The item in question is SunSynk_FW_LastUpdate and is configured as (via UI):

DateTime SunSynk_FW_LastUpdate "SunSynk FW Last Update [%1$td-%1$tm-%1$tY %1$tH:%1$tM]" (Persistence_Group)

My MapDB Persistence is configured as:

configurations:
  - items:
      - Persistence_Group*
      - SunSynk_FW_LastUpdate
      - SunSynk_MPPT_TOTAL
      - SunSynk_WiFi_LastUpdated_DateTime
    strategies:
      - restoreOnStartup
    filters: []
cronStrategies: []
defaultStrategies:
  - everyChange
  - restoreOnStartup
thresholdFilters: []
timeFilters: []
equalsFilters: []
includeFilters: []

So I have the ITEM both in the Persistence Group as well as manually added (just added to test).

Any suggestions as to how I can debug this?

Thanks
Mark

I reverted to my old text based config and it seems to work:

Strategies {
}

Items {
   Persistence_Group*	: strategy = everyChange, restoreOnStartup
   SunSynk_MPPT_TOTAL	: strategy = everyChange, restoreOnStartup
   SunSynk_WiFi_LastUpdated_DateTime	: strategy = everyChange, restoreOnStartup	
}

You are missing the everyChange strategy on this configuration. It will restore on startup, but it never gets stored in the first place. Your text configuration has this correct.

defaultStrategies will only kick in if there are no strategies defined on the configurations at all. As this is confusing (and sometimes gives unexpected results), I have PR’s open to remove these default strategies for OH 5 (Persistence no default strategies and persistence configuration health check by mherwege · Pull Request #4682 · openhab/openhab-core · GitHub).

1 Like

Thanks Mark
I actually picked that up just after I posted and added.

It still did nto work - hence me moving back to the text based config.

I will test again and revert shortly.

Appreciate the response.

EDIT - redid teh config and it works again. Thank you