Skip to content

Backups: Add backup verification rake task

What does this MR do and why?

Adds a new command to only check whether backup version matches GitLab's installation version

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

Verifying a backup before restoring (Backup version matches GitLab's version)

  1. Create a backup. i.e bundle exec rake gitlab:backup:create SKIP=db
  2. Run restore verify command i.e. : bundle exec rake gitlab:backup:verify BACKUP=1708561114_2024_02_22_16.10.0-pre
  3. The output should include the following message and exit:
         GitLab version matches:
           Your current GitLab version (<Gitlab version>) matches the GitLab version in the backup.

Verifying a backup before restoring (Backup version mismatches GitLab's version)

  1. Use an older backup, or edit the backup_manifest.yml from an existing one, changing the :gitlab_version: to a previous version
  2. Run restore verify command i.e. : bundle exec rake gitlab:backup:verify BACKUP=1708561114_2024_02_22_16.9.0-pre
  3. The output should include the following message and exit:
          GitLab version mismatch:
            Your current GitLab version (<Gitlab version>) differs from the GitLab version in the backup!
            Please switch to the following version and try again:
            version: <Gitlab version in the backup>

Part of #428505

Closes #456788

Edited by Gabriel Mazetto

Merge request reports