From bf2e53f3235729d25c254a4470f382013828a774 Mon Sep 17 00:00:00 2001 From: nbenedek Date: Tue, 7 Mar 2023 23:37:31 +0100 Subject: [PATCH] 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 [jvalleroy: Add a comment about the limitation of this approach] Signed-off-by: James Valleroy Reviewed-by: James Valleroy --- plinth/modules/ttrss/privileged.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plinth/modules/ttrss/privileged.py b/plinth/modules/ttrss/privileged.py index dcc242ef4..8f53f0ff2 100644 --- a/plinth/modules/ttrss/privileged.py +++ b/plinth/modules/ttrss/privileged.py @@ -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