These days I needed to update my GitLab which was already many versions behind. In this post I will quickly show that updating is not just an upgrade button.

At the time of installation, as described in Post https://devops-db.com/gitlab-installation/, the Cummunity Edition version was 16.9.2, after that, I updated to version 17.0.1 and then I didn’t update anymore.

In the meantime, there was a security update and these days I stopped to do it.

The issue, which also occurs with other software, is that it is not possible to update directly to the latest version, it is necessary to update a series of intermediate versions first, as these versions contain other updates that are not included in the latest one.

There is a GitLab page with the required Upgrade path: https://docs.gitlab.com/update/upgrade_paths/

Every upgrade is done beforehand, a backup of the database used for GitLab is made. On the manufacturer’s page, there is an indication of how not to backup the Database (https://archives.docs.gitlab.com/17.0/ee/update/package/index.html#back-up-before-upgrading) , saving time and disk space. But I do not recommend this procedure at all, as there are a lot of database updates in the versions and if this goes wrong, you will be left without a backup.

So as mentioned, our version was at 17.0.1 and I needed to update to the latest, 17.9.1.
If we do apt install gitlab-ce=17.9.1-ce.0 the error at the time is something like this: new gitlab-ce package pre-installation script subprocess returned error exit status 1

So, according to the instructions, I needed to first upgrade to the key versions below.

  • 17.1.8. Instances with large ci_pipeline_messages tables.
  • 17.3.7. The latest release of GitLab 17.3.
  • 17.5.z. The latest release of GitLab 17.5.
  • 17.8.z. The latest release of GitLab 17.8.

This took a long time, so keep an eye on it so you don’t do like me and miss a lot of updates.

And then, update to the latest version:

apt-get install -y gitlab-ce=17.1.8-ce.0
apt-get install -y gitlab-ce=17.3.4-ce.0
apt-get install -y gitlab-ce=17.5.0-ce.0
apt-get install -y gitlab-ce=17.8.0-ce.0
apt-get install -y gitlab-ce=17.9.1-ce.0

After a long time, the update finished and I was able to check it, both on the GitLab page and via the command line:

$ gitlab-rake gitlab:env:info

System information
System:         Ubuntu 22.04
Current User:   git
Using RVM:      no
Ruby Version:   3.2.5
Gem Version:    3.6.3
Bundler Version:2.5.11
Rake Version:   13.0.6
Redis Version:  7.0.15
Sidekiq Version:7.2.4
Go Version:     unknown

GitLab information
Version:        17.9.1
Revision:       073f7efc655
Directory:      /opt/gitlab/embedded/service/gitlab-rails
DB Adapter:     PostgreSQL
DB Version:     14.15
URL:            http://gitlab.devops-db.internal
HTTP Clone URL: http://gitlab.devops-db.internal/some-group/some-project.git
SSH Clone URL:  git@gitlab.devops-db.internal:some-group/some-project.git
Using LDAP:     yes
Using Omniauth: yes
Omniauth Providers:

GitLab Shell
Version:        14.40.0
Repository storages:
- default:      unix:/var/opt/gitlab/gitaly/gitaly.socket
GitLab Shell path:              /opt/gitlab/embedded/service/gitlab-shell

Gitaly
- default Address:      unix:/var/opt/gitlab/gitaly/gitaly.socket
- default Version:      17.9.1
- default Git Version:  2.47.2

Related Post