Terry : Upgrade GitLab From 6.0 To 6.1

GitLab 6.1

Changes

  • Project specific IDs for issues, mr, milestones
  • Above items will get a new id and for example all bookmarked issue urls will change.
  • Old issue urls are redirected to the new one if the issue id is too high for an internal id.
  • Description field added to Merge Request
  • API: Sudo api calls (Izaak Alpert)
  • API: Group membership api (Izaak Alpert)
  • Improved commit diff
  • Improved large commit handling (Boyan Tabakov)
  • Rewrite: Init script now less prone to errors and keeps better track of the service (Rovanion Luckey)
  • Link issues, merge requests, and commits when they reference each other with GFM (Ash Wilson)
  • Close issues automatically when pushing commits with a special message
  • Improve user removal from admin area
  • Invalidate events cache when project was moved
  • Remove deprecated classes and rake tasks
  • Add event filter for group and project show pages
  • Add links to create branch/tag from project home page
  • Add public-project? checkbox to new-project view
  • Improved compare page. Added link to proceed into Merge Request
  • Send email to user when he was added to group
  • New landing page when you have 0 projects

Upgrade Steps

Deprecations

Icon

Global issue numbers

In 6.1 issue numbers are project specific. This means all issues are renumbered and get a new number in their url. If you use an old issue number url and the issue number does not exist yet you are redirected to the new one. This conversion does not trigger if the old number already exists for this project, this is unlikely but will happen with old issues and large projects.

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 server

sudo service gitlab stop

2. Get latest code

su - git
cd /home/git/gitlab
git fetch
git checkout 6-1-stable

3. Update gitlab-shell

cd /home/git/gitlab-shell
git fetch
git checkout v1.7.1

4. Install libs, migrations, etc.

cd /home/git/gitlab

# MySQL
sudo -u git -H bundle install --without development test postgres --deployment

#PostgreSQL
sudo -u git -H bundle install --without development test mysql --deployment

sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production
sudo -u git -H bundle exec rake migrate_iids RAILS_ENV=production
sudo -u git -H bundle exec rake assets:clean RAILS_ENV=production
sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production
sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production 

5. Update config files

6. 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
# curl --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlabhq/6-1-stable/lib/support/init.d/gitlab
# OR
wget --no-check-certificate -O /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlabhq/6-1-stable/lib/support/init.d/gitlab
chmod +x /etc/init.d/gitlab

7. Start application

sudo service gitlab start
sudo service nginx restart

8. Check application status

Check if GitLab and its environment are configured correctly

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

To make sure you didn't miss anything run a more thorough check with

cd /home/gitlab
su - git && sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production

If all items are green, then congratulations upgrade complete!

Reference

ChangeLog