I have a backup of unknown gitlab version. My partner assume it is created by gitlab version 6.0.2 But when I implement a gitlab version 6.0.2 I am still impossible to restore it because of mismatch version. So how do I get exactly version of a gitlab backup ?
GitLab's built-in back up utility exports data created by users on your GitLab instance. This includes everything in the GitLab database and your on-disk Git repositories. Restoring the backup will reinstate your projects, groups, users, issues, uploaded file attachments, and CI/CD job logs.
GitLab provides Rake tasks for backing up and restoring GitLab instances. An application data backup creates an archive file that contains the database, all repositories and all attachments. You can only restore a backup to exactly the same version and type (CE/EE) of GitLab on which it was created.
Once logged in, your GitLab repositories and other data start backing up automatically. 3. To view your GitLab projects and backup process, go to projects and select the Backrightup option. Backup your GitLab projects and repositories with Backrightup.
Inside the tar archive there is a file called backup_information.yml
. There lies the info you are looking for. To find the version number:
tar xf 1411831804_gitlab_backup.tar -O backup_information.yml | grep gitlab_version | awk '{print $2}'
Where 1411831804_gitlab_backup.tar
the archive in question.
You could also make a simple script and loop over the backup folder like so:
for archive in $(find /home/git/gitlab/tmp/backups -name '*.tar'); do echo -ne "$archive - $(tar tf $archive backup_information.yml | grep gitlab_version | awk '{print $2}')\n"; done
Where /home/git/gitlab/tmp/backups
is the path to the backup directory. For Omnibus GitLab it is /var/opt/gitlab/backups
.
But yeah, the tar name should be more descriptive. As a matter of fact, I was thinking the same some time ago when I migrated to a packaged installation. Will submit a patch.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With