Last modified: [last-modified]
The upgrade instructions found on Gitlab’s official website are what I followed to upgrade my installation of Gitlab.
The only alterations I’ve made are to match my unique configuration from earlier articles on this website.
If you haven’t already upgrade your Gitlab to 5.4 before proceeding with these instructions. I never wrote a 5.2 -> 5.3 or a 5.3 -> 5.4 upgrade guide. The procedure was fairly straight forward and I just followed the official documents offered by Gitlab and referred to my earlier upgrade posts for 5.0 -> 5.1 and 5.1 -> 5.2.
1. Backup all of your Gitlab Data first. I ran these commands but ended up with an error. I run other separate backups so I wasn’t concerned. You may have better luck.
[root@micro ~]# su - sa_gitlab [sa_gitlab@micro ~]$ cd ~/gitlab [sa_gitlab@micro gitlab]$ RAILS_ENV=production bundle exec rake gitlab:backup:create
2. Switch back to root and install a missing dependency and shutdown Gitlab and then switch back to sa_gitlab
[sa_gitlab@micro gitlab]$ exit [root@micro ~]# yum install python-docutils [root@micro ~]# service gitlab stop # Wait 1-2 minutes for everything to shut down [root@micro ~]# su - sa_gitlab
3. Download the latest code
[sa_gitlab@micro ~]$ cd ~/gitlab [sa_gitlab@micro gitlab]$ git fetch [sa_gitlab@micro gitlab]$ git stash [sa_gitlab@micro gitlab]$ git checkout 6-0-stable
4. Update Gitlab Shell
[sa_gitlab@micro gitlab]$ cd ~/gitlab-shell/ [sa_gitlab@micro gitlab-shell]$ git fetch [sa_gitlab@micro gitlab-shell]$ git checkout v1.7.0
5. Update Gitlab
[sa_gitlab@micro ~]$ cd ~/gitlab [sa_gitlab@micro gitlab]$ bundle install --without development test postgres --deployment [sa_gitlab@micro gitlab]$ bundle exec rake db:migrate RAILS_ENV=production [sa_gitlab@micro gitlab]$ bundle exec rake migrate_groups RAILS_ENV=production # When prompted choose 'Yes' [sa_gitlab@micro gitlab]$ bundle exec rake migrate_global_projects RAILS_ENV=production [sa_gitlab@micro gitlab]$ bundle exec rake migrate_keys RAILS_ENV=production # When prompted choose 'Yes' [sa_gitlab@micro gitlab]$ bundle exec rake migrate_inline_notes RAILS_ENV=production [sa_gitlab@micro gitlab]$ bundle exec rake assets:precompile RAILS_ENV=production
6. Backup your old configuration files
[sa_gitlab@micro gitlab]$ cd config [sa_gitlab@micro config]$ mv gitlab.yml gitlab.yml.54 [sa_gitlab@micro config]$ mv unicorn.rb unicorn.rb.54
7. Create new configuration files
[sa_gitlab@micro config]$ cp gitlab.yml.example gitlab.yml [sa_gitlab@micro config]$ cp unicorn.rb.example unicorn.rb # Now move all of your settings from the .54 backups we just made into the new files # There are a lot of new lines in the unicorn.rb that need to be changed from '/home/git' to '/data/apps/sa_gitlab' # There is no longer a need to comment out the socket line in unicorn.rb
8. Update the init script
[sa_gitlab@micro config]$ exit [root@micro ~]# cd /etc/init.d/ [root@micro init.d]# mv gitlab gitlab.54 [root@micro init.d]# curl --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlabhq/master/lib/support/init.d/gitlab [root@micro init.d]# chmod +x /etc/init.d/gitlab [root@micro init.d]# vim gitlab # -------- Make the following edits -------- APP_ROOT="/data/apps/sa_gitlab/gitlab" APP_USER="sa_gitlab" # -------- Save and close the file --------
9. Start-up Gitlab 6!
[root@micro init.d]# service gitlab start # The start-up took a few minutes on my system
That’s it!
getting weird error when starting?
Starting the GitLab Unicorn web server…
/etc/init.d/gitlab: line 131: script/web: No such file or directory
Starting the GitLab Sidekiq event dispatcher…
/etc/init.d/gitlab: line 139: script/background_jobs: No such file or directory
GitLab is not running.
line 131 RAILS_ENV=$RAILS_ENV script/web start
fi
line 139: RAILS_ENV=$RAILS_ENV script/background_jobs start
I’m guessing you might have goofed up the app_root in the /etc/init.d/gitlab script. Check out line 23: app_root=”/data/apps/sa_gitlab/gitlab”
I have followed the instructions above to upgrade to 6.0 and everything went smooth. Yet when I try to access gitlab on http it gives me error 503 as per below:
Service Temporarily Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
Apache/2.2.15 (CentOS) Server at gitlab.gzero.local Port 80 I have run the bundle exec rake gitlab:check RAILS_ENV=production and it all checks fine apart from the init script that I believe is an issue since the above script compares it against debian version and I am on CentOS. I thought I will upgrade to 6.1 just in case but teh issue remains teh same. Any thoughts would be appreciated. Thanks
Check your error log. Chances are it will tell you what’s wrong. I’m guessing Unicorn isn’t starting properly. I just ran into a similar problem going to the latest version of Gitlab.
Error log is: /data/apps/sa_gitlab/gitlab/log/unicorn.stderr.log
I had to revert to the previous snapshot to have gitlab running so i had no chance lookin gon the unicorn.stderr.log. However on another attempt what seems to have sorted it out is upgrading to ruby 2.0.0-p247
Thanks for your help
Interesting. For my last upgrade to Gitlab 6.2 I upgraded Ruby to 2.x but I did it after getting Gitlab working not before (I think).