Introduction
A number of years in the past I arrange GitLab in my residence setting. I apprecate previous me documenting the essential steps I took to do that, as a result of I will want them once more in some unspecified time in the future once I make upgrades to my residence lab. I’ve documented somethings I’ve finished (like organising GitLab runners, or coping with Grafana being deprecated inside GitLab or utilzing GitLab to routinely backup my Obsidian notes) Sadly, I did not doc every thing. A kind of issues that I did not doc was altering the place my repositories are saved on disk by default.
In GitLab 17.8 (January 2025), a brand new deprecation warning began showing.
git_data_dirs has been deprecated since 17.8 and will probably be eliminated in 18.0. See https://docs.gitlab.com/omnibus/settings/configuration.html#migrating-from-git_data_dirs for migration directions.
I am somewhat irritated that there have been solely 5 months of discover on this as a result of main variations are launched in Might. In any case, in the event you try to replace to model 18 or past and are using git_data_dirs, the improve will fail.
Answer
As standard, GitLab is nice at offering documentation on resoluting and migrating via the deprecations. Nevertheless, on my first try I encountered an error. I consider it is as a result of I missed a word buried within the textual content – not the code blocks – the primary time.
Be aware that the
/repositoriessuffix should be appended to the trail as a result of it was beforehand appended internally.
The answer is to open /and so forth/gitlab/gitlab.rb (you most likely ought to make a backup first). Discover the git_data_dirs line. For me this was round line 455. Then remark out this whole block.
Then discover (or add) the gitaly['configuration'] block. This was instantly after the git_data_dirs part for me. Uncomment it, and add the suitable path (out of your git_data_dirs block) and add /repositories to the top of it.
As soon as you’re finished, run
gitlab-ctl reconfigure
gitlab-ctl restart
Give it a minute to fireside up all of the GitLab subcomponents, after which it is best to be capable of replace GitLab past model 18.
New code part
My gitlab.rb now has this:
#git_data_dirs({
# "default" => {
# "path" => "/earlier/path/to/repos"
# }
#})
### Gitaly settings
gitaly['configuration'] = {
storage: [
{
name: 'default',
path: '/previous/path/to/repos/repositories',
},
],
}
Conclusion
With this fast change, I can proceed to carry the repositories at a location of my selecting. The most important factor is so as to add /repositories to the path within the new Gitly configuration. With this transformation, I can proceed to using the present model of GitLab – a device that I nonetheless discover invaluable.
