From 52894d37ea2fc83fd2efabcdf91bca0f4a6fdd9f Mon Sep 17 00:00:00 2001 From: augustin64 Date: Wed, 10 Apr 2024 18:21:06 +0200 Subject: [PATCH] migration: Add --backup flag --- scripts/migration.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/migration.py b/scripts/migration.py index b99d1a2..c848aee 100644 --- a/scripts/migration.py +++ b/scripts/migration.py @@ -201,11 +201,18 @@ if __name__ == "__main__": "--restore", help="restore from specific version backup, will not apply any hook (vx.y.z)", ) + parser.add_argument( + "-b", + "--backup", + help="backup current version, without running any hooks", + ) args = parser.parse_args() config.instance = os.path.abspath(args.instance) - if args.restore is None: - migrate(args.current, args.target, skip_backup=args.skip_backup) - else: + if args.restore is not None: restore(args.restore) + elif args.backup is not None: + backup_instance(args.backup, verbose=True) + else: + migrate(args.current, args.target, skip_backup=args.skip_backup)