How to enable persistance? PG/Openhab2

Hi there,

I followed a tutorial on how to add persistance. I therefore added the Postgresql addon and now have a service JDBC Persistence.
I selected JDBC as the default in the configuration/system.

I then changed services/jdbc.cfg to:
url=jdbc:postgresql://192.168.1.23:5432/fhem (old fhem db)
user=fhem
password=fhem

and added a file main.persist:
Strategies {
// if no strategy is specified for an item entry below, the default list will be used
everyMinute : "0 * * * * ?"
every5Minutes : "0 */5 * * * ?"
everyHour : "0 0 * * * ?"
everyDay : "0 0 0 * * ?"
default = everyChange
}

Items {
    * : strategy = everyChange, everyDay, restoreOnStartup
}

However, I don’t see anything in the database after restart - do I have to trigger this somehow or did I miss anything?
I might have missed the right documentation, it’s a bit confusing with the switch to openhab2.

Thanks for your help!

I think that you should name the file jdbc.persist

Damn that was obvious … :frowning: Thanks a lot I didn’t get that!

Great, working now!

1 Like