I have a postgresql database on an unraid server and haos running on a nuc.
The unraid server is going to be shutdown soon so I was looking into moving my database over to a homeassistant postgres add-on.
My recorder is setup like this:
recorder:
db_url: postgresql://xxx:[email protected]/homeassistant
purge_keep_days: 14
commit_interval: 30
However I just looked in my history and I can access statistics from over 4 months ago! (Not long term statistics. I’m talking about minutely stats.
So I headed into pgadmin and to my shock, my database is 18gb large…
So the purge was definitely not working.
Now I am a bit stumped. I was planning on making a backup of my old postgres data and was expecting maybe a few 100mbs and then wanted to restore it via pgadmin in the new database running on the nuc.
I will be the first to admit, that I don’t understand anything about databases, so all help is appreciated.
Also the new backup feature was just realeased. Can I just make a backup and then restore the history data pointing at the new container?
The backup is only 400mb large so in stark contrast to the 18gb postgres database.
I don’t really care about the minutely data, but I would hate to lose 4 years of long term stored data, like solar production and energy usage.
All help is very much apprciated!