After gitlab security update restore an backup

Hello,

I’ve a GitLab installation on Debian 10. Today I tested the installation of the newest version for security updates on a test server. After this I can’t restore the backups.

gitlab-backup restore BACKUP=1594153385_2020_07_07_13.1.2-ee
Unpacking backup … done
GitLab version mismatch:
Your current GitLab version (13.2.3-ee) differs from the GitLab version in the backup!
Please switch to the following version and try again:
version: 13.1.2-ee

What is the solution for this? In the web I only found the information that a backup can installed only in the same version. But a software update is a normaly use case. And when this is failed or the data not OK after this, I must restore an old backup.

At the moment I can’t update the GitLab on the production server. That is not so good.

Thanks for our help,
Bernd

The solution is to:

  1. install the version the backup was made on
  2. restore the backup
  3. upgrade the installed version of GitLab

If nothing changed in the backup format between the version you used to make the backup and the version you’re restoring on (I haven’t kept that close watch on the backup code between those versions, but my guess would be that nothing changed), you can also edit the backup to look like it was made on the new version (I think there is more to it than renaming the file, but I didn’t pay attention to that part of the code), or remove the version check from the code, but I think both methods are much more work than just following the official way.

As the backup is normally very recent in case of updates, and old versions are easily available (on Debian it’s in the same repo, so it’s just adding =<old_version> to the install command), this is a very minor inconvenience, and compared to flexibility that comes from being able to change the backup format at will, I think this is a sane choice.

1 Like