Seperate longterm database

Hi, I have quite a few entities that update often, so my database (24h) is usually around 4gb. I’ve crashed multiple SD cards due to the many writes before I’ve moved it to /dev/shm … So basically RAM.

This works perfectly. The only drawback is that the database will be erased after a reboot (so I my case only about 1/year).

All this is fine, but now I’d like to keep my longterm data. Ideally even adds them to my backup. I could imagine that especially the backup will be a common use case.

For those reasons I’d like to ask if a seperate database file would be possible …

Thanks,
Jkw

In the meantime you can use influxdb for long-term data. I do it as well, one DB (PostgreSQL) for short-term data and one DB for long-term data (InfluxDB). You can then configure individually which entities should be recordef in which databases. You can read up on how I did it here, in case you are interested

I read your docu, thanks. Am I right that you can’t use your long-term data for native graphs inside Homeassistent?

So the energy re-view of old data wouldn’t work if you delete your recorder db, correct?

I’m basically doing the same, by storing data to a CSV file which I read back into Homeassistent to plot year-overview plots. Works, but not ideal

Yes, that’s correct. Personally I use Grafana together with InfluxDB for charting the data, as far as I can remember you can also show Grafana charts in Hone Assistant with an iFrame, but to be honest I only use Grafana for this, because it is way more powerful in this regards than Home Assistant.

Ok thanks. But I guess this feature request remains valid to process the data in HA

This might not be a smart version, but this scripts will backup the longterm data and restore it during reboot (given that you call it after reboot and every once in a while to update the backup)
JKW