Terry : Upgrade GitLab From 5.3 To 5.4

GitLab 5.4

The 3 most important improvements in GitLab 5.4
  1. Edit Comments
  2. Show Issue Participants
  3. Notifications for mentioned users

New Features

  • Ability to edit own comments
  • Allow project imports via git:// URLs
  • Show participants on issues, including mentions
  • Notify mentioned users with email


  • Documentation improvements
  • Improve dashboard projects page
  • GitLab Markdown help page
  • Increase snippet content column size


  • Fixed nav for empty repos
  • Fix PostgreSQL database restoration problem
  • Misspelling fixes


  •  Added client list to API doc


  • Added support of unicorn and fog gems

Upgrade Steps

0. backup

Backup saves lives.

NOTE: With MySQL, this may require granting "LOCK TABLES" privileges to the GitLab user on the database version.

cd /home/git/gitlab
sudo -u git -H RAILS_ENV=production bundle exec rake gitlab:backup:create

1. Stop the serer

sudo service gitlab stop

2. Get the latest code

# GitLab
su git
cd /home/git/gitlab
# git fetch
git pull
git checkout 5-4-stable
# GitLab shell
cd /home/git/gitlab-shell
git pull
git checkout v1.5.0

DO NOT forget to check config.yml to make sure the FQDN is correct. 

NOTE: GitLab 5.3 uses gitlab-shell 1.4.0 (check 5.3 installation guide) and GitLab 5.4 uses 1.5.0 as per the 5.4 installation guide, the upgrade guide always miss some parts...

3. Install libraries, migration, etc.

cd /home/git/gitlab

bundle install --without development test postgres --deployment
# PostgreSQL
bundle install --without development test mysql --deployment

# Migration
bundle exec rake db:migrate RAILS_ENV=production

bundle exec rake assets:precompile RAILS_ENV=production

4. Update config files

 5. Update init script

# Backup the old init scriptsudo cp /etc/init.d/gitlab{,.old}
sudo rm /etc/init.d/gitlab
# Download the new init script
sudo curl --output /etc/init.d/gitlab /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlabhq/5-4-stable/lib/support/init.d/gitlab
# OR
# cd /etc/init.d && sudo wget --no-check-certificate -O gitlab https://raw.github.com/gitlabhq/gitlabhq/5-4-stable/lib/support/init.d/gitlab
sudo chmod +x /etc/init.d/gitlab

6. Update Nginx Configuration File - OPTIONAL

# backup old config filecp /etc/nginx/sites-available/gitlab{,.5-3}
rm -f /etc/nginx/sites-available/gitlab
# download the latest config file
sudo wget --no-check-certificate -O /etc/nginx/sites-available https://raw.github.com/gitlabhq/gitlabhq/5-4-stable/lib/support/nginx/gitlab
sudo ln -s /etc/nginx/sites-available/gitlab /etc/nginx/sites-enabled/gitlab

7. Start the application

sudo service gitlab start
sudo service nginx restart 

8. Check Application Status

Check if GitLab and its environment are configured correctly

su git
cd /home/git/gitlab && bundle exec rake gitlab:env:info RAILS_ENV=production

To make sure nothing is missed, run a more thorough check with

su git
cd /home/git/gitlab && bundle exec rake gitlab:check RAILS_ENV=production

If all items are GREEN, then congratulations upgrade complete!



5.3 To 5.4 Upgrade Guide