mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-01-30 20:56:39 +00:00
fix: Couldn't restore postgres from backup
This commit is contained in:
parent
914b392b1d
commit
f7c3441314
|
@ -25,11 +25,10 @@ class PostgresDumper:
|
||||||
def restore_database(self, backup_file: str):
|
def restore_database(self, backup_file: str):
|
||||||
restore_command = [
|
restore_command = [
|
||||||
"pg_restore",
|
"pg_restore",
|
||||||
"--dbname=postgresql://{}@{}/{}".format(
|
f"--dbname=postgresql://{self.user}@{self.socket_dir}",
|
||||||
self.user, self.socket_dir, self.db_name
|
|
||||||
),
|
|
||||||
"--clean",
|
"--clean",
|
||||||
"--create",
|
"--create",
|
||||||
|
"--exit-on-error",
|
||||||
backup_file,
|
backup_file,
|
||||||
]
|
]
|
||||||
subprocess.run(restore_command, check=True)
|
subprocess.run(restore_command, check=True)
|
||||||
|
|
Loading…
Reference in a new issue