How to make a periodic automatic backup of the database?


I made some errors in the HA settings, so I thought that the easiest way would be to restore from a regular backup using the Google Drive Backup Home Assistant addon.
The restore was successful, but I found that the backups unfortunately do not contain database backups. All the history of my sensors is gone. It’s been a few weeks of history, so I’ll put up with it. But I would like to avoid it next time. Even in case of SD card failure.
How can I set up a daily backup of the entire database? Ideally also on Google drive or another cloud.
I use Home Assistant on RPi 3 with Mariadb.

Hi, not sure if this helps, but I noticed this one:
Are you using marcelveldt’s addon or the sabeechen version?

Personally I’m looking for an automatic backup to a network drive, icloud or synology, found this while looking for a solution.

Thank you for answer. I already use this addon. Unfortunately, it does not back up the database.
I’ve already tried recovery with it and the system and all installed things were restored properly, but unfortunately the whole database was gone. All measured values disappeared.
I would like to find a way to reliably store and back up, for example, the history of the outdoor temperature.

1 Like

I faced the same issue today. History + long term statistics from energy dashboard were gone… Did you find a work around for backing up the db along with the home assistant?