Fix restoring backups

Signed-off-by: Lukas Schaefer <lukas@lschaefer.xyz>
This commit is contained in:
2026-01-11 22:50:38 -05:00
parent 436e206277
commit 899d223de1

View File

@@ -112,10 +112,16 @@ def restore(fileName):
dbInfo = readFile(
__file__[: __file__.rindex("/python/database.py") + 1] + "html/config.json"
)
location = dbInfo["database"]["backupLocation"]
username = dbInfo["database"]["username"]
password = dbInfo["database"]["password"]
database = dbInfo["database"]["name"]
location = dbInfo["database"]["backupLocation"]
host = dbInfo["database"]["host"]
port = dbInfo["database"]["port"]
locationdata = f"{location}/{fileName}"
os.system(f"mysql {database} < {locationdata}")
os.system(
f"mysql -u {username} --host={host} --port={port} --password={password} {database} < {locationdata}"
)
def search(table, where, search="*"): # searches for value in table