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 ?
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.