meta data for this page
This is an old revision of the document!
gitlab
Download location: https://packages.gitlab.com/gitlab/gitlab-ce
Archive versions: https://about.gitlab.com/downloads/archives/
Configure Gitlab's web server: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/settings/nginx.md
gitlab-ctl stop gitlab-ctl start
Get installed version info
gitlab-rake gitlab:env:info
gitlab-ctl tail
gitlab-rake gitlab:app:check
gitlab-rake gitlab --tasks
Configuration
- /etc/gitlab/gitlab.rb
# will be started on :80 port external_url "http://gitlab.example.com" # will be started on :443 port # by default certificate file same as hostname is required: # /etc/gitlab/ssl/gitlab.example.com.key # /etc/gitlab/ssl/gitlab.example.com.crt external_url "https://gitlab.example.com" # redirect http to https nginx['redirect_http_to_https'] = true external_url "https://gitlab.example.com:2443" nginx['ssl_certificate'] = "/etc/gitlab/ssl/gitlab.crt" nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/gitlab.key" git_data_dir "/mnt/nas/git-data"
sudo gitlab-ctl reconfigure
Uninstall
# Stop gitlab and remove its supervision process sudo gitlab-ctl uninstall # Debian/Ubuntu sudo dpkg -r gitlab
Making backup
- block gitlab access (but leave maintenance web page)
- gitlab-ctl deploy-page up
- sudo gitlab-ctl stop unicorn
- sudo gitlab-ctl stop sidekiq
- Store configuration file manually (/etc/gitlab)
- Trigger backup creation
gitlab-rake gitlab:backup:create
- Start gitlab
gitlab-ctl start
gitlab-ctl deploy-page down
Automating backups
crontab -e
0 2 * * * /opt/gitlab/bin/gitlab-rake gitlab:backup:create CRON=1
Restoring backup
- install exactly the same version from backup comes
- install default gitlab package and make sure it is running
- use /etc/gitlab from backup
- run
gitlab-ctl reconfigure
- stop gitlab
sudo gitlab-ctl stop unicorn
sudo gitlab-ctl stop sidekiq
- Restore backup
sudo gitlab-rake gitlab:backup:restore
- OR
sudo gitlab-rake gitlab:backup:restore BACKUP=1393513186
- Start GitLab
sudo gitlab-ctl start
- Check GitLab
sudo gitlab-rake gitlab:check SANITIZE=true
Gitlab 7.4 empty repos issue
It is not possible to restore backup with empty repos.
Issue described here Restore issue with empty projects
- File to fix
/opt/gitlab/embedded/service/gitlab-rails/lib/backup
gitlab:check errors
Projects have satellites? ... 4/1 ... no Try fixing it: sudo -u git -H bundle exec rake gitlab:satellites:create RAILS_ENV=production If necessary, remove the tmp/repo_satellites directory ... ... and rerun the above command For more information see: doc/raketasks/maintenance.md Please fix the error above and rerun the checks. 4/2 ... no
- Create missing satellites
sudo gitlab-rake gitlab:satellites:create
sudo gitlab-ctl restart
sudo gitlab-rake cache:clear
Ubuntu Precise Gitlab 7.4 update
* Create LXC container with the same version as your working gitlab instance
- Ubuntu LTS 12.04 Precise
- Gitlab 7.4 (gitlab_7.4.3-omnibus.5.1.0.ci-1_amd64.deb)
- copy /etc/gitlab form your working instance
- execute
gitlab-ctl reconfigure
* Update Gitlab to latest version
- Follow official instructions to gitlab repos: Install a GitLab CE Omnibus package
- Upgrade gitlab version: Update GitLab Community Edition
* Make backup
* Create LXC container with latest Ubuntu Xenial release
- Follow official instructions to gitlab repos: Install a GitLab CE Omnibus package
- edit
/etc/apt/sources.list.d/gitlab_gitlab-ce.list
and change distro totrusty
apt-get install gitlab-ce
gitlab-ctl reconfigure
- get /etc/gitlab from previous LXC container
gitlab-ctl reconfigure
to adapt directory structure to new configuration- get gitlab backup from previous LXC container
FQDN issue
ERROR: External URL must include a FQDN
- external_url = 'gitlab.thefallenphoenix.net'
external_url = 'gitlab.thefallenphoenix.net'