Can git-data/repositories/+gitaly safely be removed after restore?

Hi,

I created a backup of an 11.2.3 CE Omnibus installation and did a restore on a new machine.

The restore went fine, everything works. But I now have an additional directory named

/var/opt/gitlab/git-data/repositories/+gitaly

on the new server. Inside that directory there are more directories:

tmp/default-repositories.old.1537271955.221854098/

In there are folders with the same names as my repositories.

Looking at the actual repository configs at

/var/opt/gitlab/git-data/repositories/*/*.git/config

I can see that all these config files now have 2 lines added that aren’t in the repos config files on the server I took the backup from:

[remote "origin"]
        url = /var/opt/gitlab/git-data/repositories/+gitaly/tmp/repo621855380/repo.bundle

The mentioned directory or file repo621855380/repo.bundle doesn’t exist under /var/opt/gitlab/git-data/repositories/+gitaly/tmp/.

The gitlab:cleanup:dirs task says:

/var/opt/gitlab/git-data/repositories
Looking for directories to remove... 
Can be removed: /var/opt/gitlab/git-data/repositories/+gitaly
To cleanup this directories run this command with REMOVE=true

My questions are:

  • Is it safe to remove the +gitaly directory?
  • Why is the directory still there after a restore if it’s safe to remove it?
  • Why has each repo config a “remote origin” added that points to a (nonexisting) path under /var/opt/gitlab/git-data/repositories/+gitaly/?

Thanks a lot.

First, disable gitaly, add to the config /etc/gitlab/gitlab.rb :
gitaly[‘enable’] = false

Then reconfigure :
gitlab-ctl reconfigure

Then run:
gitlab-rake gitlab:cleanup:dirs REMOVE=true