Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find version of gitlab backup?

Tags:

gitlab

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 ?

like image 584
Luke Nguyen Avatar asked Sep 25 '14 09:09

Luke Nguyen


People also ask

Is GitLab backed up?

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.

How does GitLab backup work?

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.

How do I backup a GitLab project?

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.


1 Answers

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.

like image 111
axil Avatar answered Oct 03 '22 21:10

axil