-1

I have a private Gitlab server on a Ubuntu machine. Now I, for some reason, accidentally partially uninstalled Gitlab by executing a mistyped apt-get command. I don't know which one exactly, but it started removing Gitlab from the system. I immediately saw something was wrong so I CTRL-C'd my way out of the command.

Few facts:

  • Gitlab isn't working any more
  • The command gitlab-ctl doesn't exist anymore
  • In the /etc/gitlab folder I see gitlab-secrets.json, gitlab.rb, gitlab.rb.save, gitlab.rb.save.1 and a folder trusted-certs
  • In /opt/gitlab I see 6 folders: embedded, etc, init, service, sv and var
  • In /var/opt/gitlab I see backups bootstrapped git-data gitlab-ci gitlab-rails gitlab-shell: gitlab-workhorse logrotate nginx postgresql redis trusted-certs-directory-hash
  • I stopped the uninstallation after about 5 seconds

I sadly didn't make any backups of the Gitlab server, but the Gitlab was used heavily, and I need my data back.

I know the GIT repo's are in /var/opt/gitlab/git-data. And I assume the database is in /var/opt/gitlab/postgresql.

Can I recover my Gitlab and it's data (MR's, commits etc)? If so, how would I go about doing so? I assume the data is there, but it's partially uninstalled. Any help would be appreciated.

Basaa
  • 109
  • 3

1 Answers1

1

Right, after making a full server backup, I simply reinstalled Gitlab via apt-get, and after a reboot the entire Gitlab server was working, with all the old repo's, users, MR's and commits.

So after all it was way easier than expected.

Basaa
  • 109
  • 3