mirror of
https://github.com/Casvt/MIND.git
synced 2026-04-03 03:00:22 -04:00
Copy over last DB backup timestamp on DB import
When importing a backup from a long time ago (more than one DB backup interval ago), a backup would be created the moment the import was done, regardless of when the previous backup was made (so even when that was minutes ago). Now the schedule is kept, by copying over the timestamp of the last DB backup from the current DB to the imported DB.
This commit is contained in:
@@ -243,11 +243,16 @@ def import_db(
|
||||
)
|
||||
raise
|
||||
|
||||
if copy_hosting_settings:
|
||||
hosting_settings = config_current.fetch_all()
|
||||
for key, value in hosting_settings:
|
||||
if key in ('host', 'port', 'url_prefix'):
|
||||
config_new.update(key, value)
|
||||
hosting_settings = config_current.fetch_all()
|
||||
for key, value in hosting_settings:
|
||||
if (
|
||||
key == 'db_backup_last_run'
|
||||
or (
|
||||
copy_hosting_settings
|
||||
and key in ('host', 'port', 'url_prefix')
|
||||
)
|
||||
):
|
||||
config_new.update(key, value)
|
||||
|
||||
cursor_new.connection.commit()
|
||||
cursor_new.connection.close()
|
||||
|
||||
Reference in New Issue
Block a user