backups: Implement backup/restore of key/value settings

- Implemented within the backup component. Scope for implementing database
backup/restore in similar way.

- Add new 'settings' key in the backup manifest to allow keys to backed up and
restored.

- Implement by dumping/loading settings from DB into the file.

Tests:

- Unit tests.

- Backup/restore tests for dynamicdns workss.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2022-02-10 20:31:36 -05:00
1 parent a9c6e96a95
commit 59c5e58549
8 files changed
+188 -6

No files matched your search

+2
View File
@@ -113,10 +113,12 @@ class WordPressBackupRestore(BackupRestore):
def backup_pre(self, packet):
"""Save database contents."""
super().backup_pre(packet)
actions.superuser_run('wordpress', ['dump-database'])
def restore_post(self, packet):
"""Restore database contents."""
super().restore_post(packet)
actions.superuser_run('wordpress', ['restore-database'])