Allow restore tasks to be skipped using SKIP
What does this MR do and why?
Fixes #19347 (closed)
Allows skipping specific restore tasks when restoring a backup. This allows for a more selective restore when restoring everything hasn't worked.
How to set up and validate locally
- Create a backup
$ bundle exec rake gitlab:backup:create ... 2022-03-29 10:50:50 +1300 -- Backup 1648504234_2022_03_29_14.10.0-pre is done.
- Restore with some tasks skipped. Restore doesn't log anything when a task is skipped. So the absence of these tasks indicates success here.
bundle exec rake gitlab:backup:restore BACKUP=1648504234_2022_03_29_14.10.0-pre SKIP=repositories,db 2022-03-29 10:52:52 +1300 -- Unpacking backup ... 2022-03-29 10:52:53 +1300 -- Unpacking backup ... done 2022-03-29 10:52:53 +1300 -- Restoring uploads ... 2022-03-29 10:52:53 +1300 -- Restoring uploads ... done 2022-03-29 10:52:53 +1300 -- Restoring builds ... 2022-03-29 10:52:53 +1300 -- Restoring builds ... done 2022-03-29 10:52:53 +1300 -- Restoring artifacts ... 2022-03-29 10:52:53 +1300 -- Restoring artifacts ... done 2022-03-29 10:52:53 +1300 -- Restoring pages ... 2022-03-29 10:52:53 +1300 -- Restoring pages ... done 2022-03-29 10:52:53 +1300 -- Restoring lfs objects ... 2022-03-29 10:52:53 +1300 -- Restoring lfs objects ... done 2022-03-29 10:52:53 +1300 -- Restoring terraform states ... 2022-03-29 10:52:53 +1300 -- Restoring terraform states ... done 2022-03-29 10:52:53 +1300 -- Restoring packages ... 2022-03-29 10:52:53 +1300 -- Restoring packages ... done ...
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by James Fargher