简体   繁体   中英

Change the attachment storage directory in Gitlab

I have an Omnibus installation of Gitlab and by default it stores all attachments to /var/opt/gitlab/gitlab-rails/uploads .

Unfortunately the drive is pretty small and I would like to store the attachments on a different drive. Is there some configuration magic (or something else) that can make this happen.

You should be able to change your omnibus configuration ( /etc/gitlab/gitlab.rb ) to customize that path, as described in " Change default file locations ":

user['home'] = '/gitlab-data/home'
git_data_dir '/gitlab-data/git-data'
gitlab_rails['shared_path'] = '/gitlab-data/shared'
gitlab_rails['uploads_directory'] = "/gitlab-data/uploads"
gitlab_ci['builds_directory'] = '/gitlab-data/builds'

To move the git home directory, all GitLab services must be stopped. Run gitlab-ctl stop && initctl stop gitlab-runsvdir .
Then continue with the reconfigure.

Run sudo gitlab-ctl reconfigure to start using the central location. Please be aware that if you had existing data you will need to manually copy/rsync it to these new locations and then restart GitLab.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM