From e1f02d9fa51563866e8344cda88cda9d0c753e57 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Sat, 4 Mar 2023 09:59:16 -0800 Subject: [PATCH] Add SQLite feature to NEWS and also integrations. --- NEWS | 3 +++ README.md | 1 + borgmatic/hooks/sqlite.py | 2 +- docs/how-to/backup-your-databases.md | 14 +++++++------- docs/static/sqlite.png | Bin 0 -> 4668 bytes setup.py | 2 +- 6 files changed, 13 insertions(+), 9 deletions(-) create mode 100644 docs/static/sqlite.png diff --git a/NEWS b/NEWS index 60e61f0..39cb6c2 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ +1.7.9.dev0 + * #295: Add a SQLite database dump/restore hook. + 1.7.8 * #620: With the "create" action and the "--list" ("--files") flag, only show excluded files at verbosity 2. diff --git a/README.md b/README.md index 402a727..3b92dd3 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,7 @@ borgmatic is powered by [Borg Backup](https://www.borgbackup.org/). MySQL      MariaDB      MongoDB      +SQLite      Healthchecks      Cronitor      Cronhub      diff --git a/borgmatic/hooks/sqlite.py b/borgmatic/hooks/sqlite.py index 637e7e9..9e7ecf3 100644 --- a/borgmatic/hooks/sqlite.py +++ b/borgmatic/hooks/sqlite.py @@ -106,7 +106,7 @@ def restore_database_dump(database_config, log_prefix, location_config, dry_run, try: os.remove(database_path) - logger.warn(f'{log_prefix}: Removed existing SQLite database at {database_path}') + logger.warning(f'{log_prefix}: Removed existing SQLite database at {database_path}') except FileNotFoundError: # pragma: no cover pass diff --git a/docs/how-to/backup-your-databases.md b/docs/how-to/backup-your-databases.md index 3e1cf2a..49388b9 100644 --- a/docs/how-to/backup-your-databases.md +++ b/docs/how-to/backup-your-databases.md @@ -16,7 +16,7 @@ consistent snapshot that is more suited for backups. Fortunately, borgmatic includes built-in support for creating database dumps prior to running backups. For example, here is everything you need to dump and backup a couple of local PostgreSQL databases, a MySQL/MariaDB database, a -MongoDB database and a SQLite database: +MongoDB database, and a SQLite database: ```yaml hooks: @@ -29,7 +29,7 @@ hooks: - name: messages sqlite_databases: - name: mydb - path: /var/lib/sqlite3/mydb.sqlite + path: /var/lib/sqlite3/mydb.sqlite ``` As part of each backup, borgmatic streams a database dump for each configured @@ -160,11 +160,11 @@ bring back any missing configuration files in order to restore a database. ## Supported databases -As of now, borgmatic supports PostgreSQL, MySQL/MariaDB, MongoDB and SQLite databases -directly. But see below about general-purpose preparation and cleanup hooks as -a work-around with other database systems. Also, please [file a -ticket](https://torsion.org/borgmatic/#issues) for additional database systems -that you'd like supported. +As of now, borgmatic supports PostgreSQL, MySQL/MariaDB, MongoDB, and SQLite +databases directly. But see below about general-purpose preparation and +cleanup hooks as a work-around with other database systems. Also, please [file +a ticket](https://torsion.org/borgmatic/#issues) for additional database +systems that you'd like supported. ## Database restoration diff --git a/docs/static/sqlite.png b/docs/static/sqlite.png new file mode 100644 index 0000000000000000000000000000000000000000..6b3edd54727a8f7f3b0eeaceac06ce13792ac0b4 GIT binary patch literal 4668 zcmV-C62t9@P)EX>4Tx04R}tkvmAkKpe)uKBOWQ5jzxd$WWc^;tR)Gg(6f4wL+^7CYQdTNkfw2 z;wZQl9DFQR9bBAsb#N5~!3T(|i<6>@l=#1-&?3fz<9>X1-^bl|fWKK~su@fGs%9CP zR8q+0SB20k0tjLd(}+sU)aOJo4bSm)4B zbKWP8u(G5OpA(N8bV1@ruFEdJaV|OR=a~^Bo0%t$5DTR)mb;jh4V8F`IHsr?<@<9k zE1b7DtJOMd-;=*ET+mjQxlVHgDJ)_MA_T~&qk<|d#A($?F_EGDq=$dl@r&e=$yEU( z#{z0lAvu2VKlt6PS)813lfp@$=f$=^MuE^S&}!KB_pxoaPJqBOaHVzpwI(q8NqVEB z#g2f1ZQ$a%qse=~?~${EP9-DzT_NQYy^hH1Xgsk&eY`U>@1elWRje0w&Yx<)QrybjH^31b)P%%G}i6^A41TNxYLs-gJlGM!Jqq`t&VevAZWjD)JRG-`Y#f~*`~biB^g@=c&NY?h?F($oY> zWCVJ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