Fix restoring backups
Signed-off-by: Lukas Schaefer <lukas@lschaefer.xyz>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user