Scheduled extract and purge of database to external location?

Hi,
First of all, I am by no means an expert in databases, so if the question is stupid, just let me know :slight_smile:

I have restricted logging for the recorder to avoid that my homeassistant database would grow too much to clog up/fill the system (I´m using Hassio on an RPI3+ wiht 64gb SD card)… Still I would like to learn about some tools and analytics around the database of home assistant, so I was thinking if the following would make sense :slight_smile:

  • No restriction on logging in the recorder
  • If the database size is above a certain size (e.g. 300 MB), then extract the database to a separate file
  • If writing successful, then purge the same records from the original database.
  • Move that separate file to another location (e.g dropbox)
  • Append the separate file in Dropbox to a masterfile in e.g. my Synology NAS or PC to one huge database which can be used for analytics

Like this the RPI has no overload of data and I could still have “infinite” history to analyse.
Would this be something unrealistic?
Thanks!

1 Like