mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-03-11 09:04:54 +00:00
ttrss: fix failing backup
Closes: #2206 Use pg_dumpall instead of pg_dump. Test I did: 1. Install tt-rss and add a feed 2. Create a backup 3. On a fresh installation restore the backup from file Signed-off-by: nbenedek <contact@nbenedek.me> [jvalleroy: Add a comment about the limitation of this approach] Signed-off-by: James Valleroy <jvalleroy@mailbox.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
e974ac735a
commit
bf2e53f323
@ -113,7 +113,10 @@ def dump_database():
|
||||
"""Dump database to file."""
|
||||
os.makedirs(os.path.dirname(DB_BACKUP_FILE), exist_ok=True)
|
||||
with open(DB_BACKUP_FILE, 'w', encoding='utf-8') as db_backup_file:
|
||||
_run_as_postgres(['pg_dump', 'ttrss'], stdout=db_backup_file)
|
||||
# XXX: Currently, ttrss is the only app that uses
|
||||
# PostgreSQL. If another app was using it, then its data would
|
||||
# be included in the backup here.
|
||||
_run_as_postgres(['pg_dumpall'], stdout=db_backup_file)
|
||||
|
||||
|
||||
@privileged
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user