Restoring a Gitlab Bundle

I had an odd request today from a guy who had deleted his GitLab project and his local repos. I had been making backups using:

and sifting through the backups under /var/opt/gitlab/backups/  I extracted the latest tar and under the ./repositories/username directory found some .bundle files for each of his projects.

After some piddling about with git bundle unbundle

I read that the bundle files are now just tar archives so I extracted the bundle file. e.g.

then noticed the familiar directory layout:

Although I did not have the working files and some of the git commands I ran gave the error:

So I created some empty directories e.g.

I then moved the extracted bundle files so that they were contained under /tmp1/.git

I then used a git clone to recreate the files from the bundle into a new directory:

This gave a working copy of the files he needed.

 

Leave a Reply

  • (will not be published)

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">