My gitlab installation is running out of space. I want to move the user's repositories to another drive. I can not find any walkthroughs or good forum posts about doing this.
I have tries moving /opt/gitlab/apps/gitlab/repositories
to another drive, and then creating a symlink from the original folder name to the new one. This worked as far as it allowed me to read the data in the repositories, but it failed at the point of trying to create a new repo, when trying to push to the master branch (git push -u origin master
), stating that I had no permission to commit to master. When I put the folder back in place instead of the symlink, all went back to working as expected.
Is there a better/correct way to move the repositories into a different location, and different drive on the system?
It seems that the new parent directory on the new device has wrong permissions. Check owner, group, and permissions of the parent directory of all repositories on the old and the new location.
Also, in case it really is caused by the symlink (which I doubt), you could use
mount --bind
instead of a symlink to rebind the directory to the new disk.assuming you set up pki / non-interactive authentication with github (ie. uploaded authenticated corresponding public key so that when you run git pull, your ~.ssh/id_dsa or ~..ssh/is_rsa private key is read for authentication).
the problem is most likely the corrensponsding private key is missning on the new device in:
make sure your private key is pasted over to that location, uid is correct, and chmod 0400 it or is wont work.
EDIT:
so once your public key is upped to github, anyone with the corresponding private key can download / change / delete your source code. if it has been compropised, you can revoke it and add another one as long as you have login atccess to github portal or access to email on file with github or change psassword / get into portal
private key should be kept offline and encrypted
Put you development team to a hold, you are about to change the configuration.
Create a directory on your new drive or a location with enough space, in my case, to give some future location independence, will use a link instead of an absolute location.
now, using your favorite editor modify
/etc/gitlab/gitlab.rb
:then use
rsync
or any other tool to copy the current location to the new one. You can delete later once you verify everything is working.