Database Dumps

Rattail can dump all of your databases to file so that they can be included in the filesystem backup that happens via rsync and/or borg create.

It only supports PostgreSQL and MySQL/MariaDB but those should work out of the box. It will figure out which databases are present, then dump each to its own file. Note that it puts them all in the /root/data folder by default.

Configuration

You can enable the database dump feature like so:

[rattail.backup]
dbdump = true

Note that the dbdump feature is enabled by default; you can disable like so:

[rattail.backup]
dbdump = false

If you don’t like /root/data then you can change output folder:

[rattail.backup]
dbdump.output = /my/preferred/folder

Exclude certain databases which you do not need backed up (note, it does not matter if these live in PostgreSQL or MySQL, Rattail will just ignore these regardless where they’re found):

[rattail.backup]
dbdump.exclude = mytestdb, anotherdb

Alternate syntax for that, useful for longer lists:

[rattail.backup]
dbdump.exclude =
    mytestdb
    anotherdb

Or, only include certain databases and exclude all others:

[rattail.backup]
dbdump.include =
   importantdb
   anotherdb

If you want, Rattail can dump all tables individually as well as dumping the databases themselves. Each database file will be accompanied by a folder which will contain the table files:

[rattail.backup]
dbdump.dump_tables = true