Adding ci_secure_files to backup rake task
What does this MR do and why?
This MR adds Project-level Secure Files to be included in GitLab backups.
Closes: gitlab-org/incubation-engineering/mobile-devops/readme#123 (closed)
Screenshots or screen recordings
How to set up and validate locally
- Upload a file to Secure Files by going into Settings > CI/CD for any project and uploading a file in the Secure Files section at the bottom of the page.
- Run the following rake task to run a backup of only the DB and Secure Files:
bundle exec rake gitlab:backup:create SKIP=repositories,uploads,builds,artifacts,pages,lfs,terraform_state,registry,packages
- Note the backup name in the output, something like
Backup 1684444017_2023_05_18_16.0.0-pre is done.
- Once the backup completes look in
tmp/backups
in the gitlab project and confirm that a new backup tar file has been created - Untar that file and confirm a
ci_secure_files
tar file has been created - Untar that file and confirm the file you uploaded was included in the backup. Note: you won't be able to view that file as it's been encrypted
- Back in the gitlab project, delete the file you uploaded, so we can restore it from the backup
- Now run
bundle exec rake gitlab:backup:restore BACKUP=1684444017_2023_05_18_16.0.0-pre
, replacing1684444017_2023_05_18_16.0.0-pre
with your backup name (this takes a while) - Once the restore is done, got back to your project and confirm that the file has been restored
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 Darby Frey