Last modified: [last-modified]
These are instructions on how to upgrade Gitlab 5.0 to 5.1 on CentOS 6.
This guide assumes you already followed my How to install Gitlab 5.0 on CentOS 6 or RHEL6 post.
- As the root user stop the Gitlab service
[[email protected] ~] service gitlab stop # Wait a few moments before continuing. Shutting down Gitlab took 30sec-1min on my system.
- Switch to the ‘sa_gitlab’ user account and move into your gitlab directory
[[email protected] ~] su - sa_gitlab [[email protected]~] cd gitlab
- Update Gitlab source from 5.0 to 5.1
[[email protected]~] git fetch [[email protected]~] git checkout 5-1-stable
- Configure Puma which is replacing Unicorn
[[email protected]~] cp config/puma.rb.example config/puma.rb [[email protected]~] vim config/puma.rb # -------- Make the following edits -------- application_path = '/data/apps/sa_gitlab/gitlab' bind 'tcp://127.0.0.1:65527' # -------- Save and close the file --------
- Redeploy Gitlab (I think that’s what this does anyway)
# You may not need to do this. I ran into some errors during my upgrade but my ISP was having problems at the time. It won't hurt to run these commands either way. [[email protected]~] gem install sanitize -v '2.0.3' [[email protected]~] gem install jquery-rails -v '2.1.3' # These commands you DO need to run [[email protected]~] bundle install --without development test postgres --deployment [[email protected]~] bundle exec rake db:migrate RAILS_ENV=production [[email protected]~] bundle exec rake migrate_merge_requests RAILS_ENV=production # When prompted choose 'Yes'
- Switch back to root and update the Gitlab start-up script
[[email protected]~] exit [[email protected] ~] mv /etc/init.d/gitlab /etc/init.d/gitlab.50 [[email protected] ~] curl --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlab-recipes/5-1-stable/init.d/gitlab [[email protected] ~] vim /etc/init.d/gitlab # -------- Make the following edits -------- # The lines with a + are lines you need to add to the script APP_ROOT="/data/apps/sa_gitlab/gitlab" + APP_USER="sa_gitlab" # Search/Replace "sudo -u git" with "sudo -u $APP_USER" # -------- Save and close the file -------- [[email protected] ~] chmod +x /etc/init.d/gitlab
- Start up Gitlab and then restart Apache if your using mod_proxy
[[email protected] ~] service gitlab start [[email protected] ~] service httpd restart
- Update Gitlab Shell
[[email protected] ~] su - sa_gitlab [[email protected]~] cd gitlab-shell [[email protected]~] git pull [[email protected]~] bin/install [[email protected]~] bin/check
All done! Hopefully this went slightly more smoothly for you then it did me. I noticed the first time loading Gitlab after the upgrade as a bit slow but things were nice and quick after that.
Updated April 26th, 2013 – Added instructions for updating Gitlab shell.
Updated May 22nd, 2013 – Wrote an article on How to go from 5.1 to 5.2