How can I recover repositories from failed instance?

Hey all. I have a failed gitlab instance that refuses to boot (docker image, gitlab-ce). I have all of the files backed up, but I want to be able to migrate off of gitlab since this is the 3rd upgrade failure that I’ve had within a year. I want to be able to get all of my git repositories out of the files that I have. Where are they located?

Hi @kiwidoggie

it depends how you have setup volumes for the GitLab container. If you used volumes you need to start another container with those volumes and copy the data out. In GitLab container the GIT data are stored in /var/opt/gitlab/git-data

I am sorry you have trouble with upgrades, please make sure you follow the official upgrade docs as with GitLab it is not as simple as to just change version/tag of the container.

I use volume mounts so it shouldn’t be that much of an issue, I followed all of the instructions and getting a non-descript rails error which has happened in many other threads but none of the issues are able to be resolved:

Thanks so far, are the repo’s stored in any particular way so i can move them to like a github, or gitea, or a fresh gitlab instance?

They are stored as Git bare repositories. Moving them means creating empty repos on the new server and pushing from local one by one.

GitLab 12 is really old. Also there is no point running GitLab in Docker if you don’t have to. The RPM/DEB packages work just fine.

1 Like

I was on 16.0.0 before upgrading, but it was the same error with gitaly. Restoring the backup of 16.0.0 doesn’t seem to work, I don’t think that the specific version was saved when it was on :latest. This was not in a “full” environment for security reasons. That’s why docker was chosen