Database backup

Hi all,

I was wondering if you use the sudo openhabian-config if the persistance database is also included in the backup file?

If not, where is the database located, such that I can make a manual copy?

Thank you,

Ramon

Which database? If it’s MapDB or rrd4j I think it does. If an external database server like InfluxDB, you have to back those up separately. They are not part of openHAB so they don’t get backed up as a part of openHAB. It’s best to look at the docs for the database in use for backup and restore instructions.

I have this in jdbc.cfg: url=jdbc:mysql://127.0.0.1:3306/
So that would make it mysql. I do see some files in /var/lib/mysql im guessing its stored there?

Then you need to go look up instructions to backup and restore MySQL. For databases it’s rarely enough to just grab a folder.

Alright, thank you for your guidance!

Ok I found the answer, let me share that in case somebody else has the same question:

sudo mysqldump -p --all-databases > /var/lib/openhab/backups/all_databases.sql