Upgrading GitLab server

gitlab_logoI got a running GitLab server on my Debian Jessie server. GitLab Community Edition is an open-source git repository manager, but also supports code reviews, wiki’s, issue tracking and much more! GitLab is very similar to Github in a way, however you have full control of the server. You are running your own git server. Normally Github will do all the system administration, upgrades and such for you. They make sure your code is safe and saved no matter what. Since I use GitLab, I need to take care of my own server. What you definitively not want is; to lose all your precious data!

Back-up

I have setup my GitLab via Omnibus installation. Not long ago GitLab 8.2.2 was released (last updated version: 8.9.6), which is again a big stable milestone release. I dont’ trust the upgrade scripts they provide (no offence), so I let Postgresql running in order to create a database as well:

sudo gitlab-ctl stop unicorn 
sudo gitlab-ctl stop sidekiq 
sudo gitlab-ctl stop nginx 
sudo gitlab-rake gitlab:backup:create

Back-ups are stored in /var/opt/gitlab/backup. When you changed your location in your  /etc/gitlab/gitlab.rb configuration file (see gitlab_rails['backup_path']), the backup will be stored there. Be sure you also make backups to another server / computer. Even better: another location out-side your home or where the server is hosted. The back will backup all your repositories, wikis, database and uploads (images). The back-up doesn’t back-up your configuration files. So be aware of that! Your GitLab configs can be found in the /etc/gitlab folder.

Let's start upgrading

Let’s start upgrading

Upgrade

When use use the Omnibus setup, a new gitlab_gitlab-ce.list file is part of our /etc/apt/sources.list.d/ directory. Meaning APT knows where to get the latest GitLab deb package.
To upgrade  your GitLab to the latest version, just run:

sudo apt-get update
sudo apt-get upgrade

Or if you only want to upgrade GitLab run:

sudo apt-get install gitlab-ce

If you are running CentOS instead of Debian run:

sudo yum install gitlab-ce

gitlab_version

When the server doesn’t works (correctly), try restarting the server after an upgrade:

sudo gitlab-ctl restart

You can also check the logging if you are interested or for debugging purposes:

sudo gitlab-ctl tail

Also check if all services are up:

 sudo gitlab-ctl status

And finally to a configuration check:

sudo gitlab-rake gitlab:check SANITIZE=true

Good luck upgrading and have fun using GitLab!

UPDATE

Ow boy ow boy ow boy. Upgrading major versions (v8.x to v9.x) in Gitlab give me headache right now.

Did you like the article? Please share!
  • Sysix

    nice tutorials, it helps me a lot

    • Melroy van den Berg

      You’re welcome!

  • Massimiliano Adamo

    @melroyvandenberg:disqus what do you mean when you say “I don’t trust the update script”? Did you meet problems so far? I am seriously planning to NOT update gitlab.
    1. the update takes too long
    2. the self-contained Chef code it’s kind of scary procedure, but I would really like to know if someone have had problems with it.

    • Melroy van den Berg

      I mean you should never trust any scripts out of your control, which may or may not damage your fragile data. That is why I advise you to make backups of your data, especially before doing an update/upgrade.

      In fact I did had a problem in the past, only once (could be worse). In this situation I was forced to remove some depreciated parameter from the YML configuration file in order to keep everything up & running. See problem 1535 at Gitlab.com, see this isue: https://gitlab.com/gitlab-org/omnibus-gitlab/issues/1535. But I think this is solved again in newer versions so don’t be afraid.

      I understand your situation and fear, but updating have some benefits. They fix security issues and secondly you get the latest version with all the new features and options. I think Gitlab makes create new features in every release. For example: KanBan board (agile of way of working) or Continuous Integration fully integrated and built-in (before it was a separate project with a separate URL).

  • Thanks!

    • Melroy van den Berg

      You’re welcome.