How to Upgrade Your Omnibus GitLab

Muhammet Düzenli
KoçSistem
Published in
4 min readMar 29, 2023

Hello,

In this article, I will guide you through the process of upgrading GitLab in the easiest and most-secure way.

· Introduction
· Before Starting
· The Upgrade Process
· Health Check of the New Version
· References

Introduction

GitLab is a popular web-based Git repository manager that provides a powerful set of features for code collaboration, version control, and continuous integration/continuous delivery (CI/CD) pipeline automation. GitLab Omnibus is a comprehensive software package that bundles GitLab with all its dependencies, making it easy to install and upgrade on Linux systems.

Upgrading GitLab can sound like a complicated task, especially for novice users but there is nothing to worry about. In this blog post, I will guide you through the process of upgrading GitLab Omnibus on Linux, step-by-step. If you’re upgrading from an older version of GitLab this guide will help you ensure a smooth, safe and successful upgrade.

Before Starting

Before performing version upgrades, the currently active version and the desired version you want to upgrade to should be determined first.

With the tool provided by GitLab, the most accurate upgrade path is recommended to you with the necessary commands.

The tool also shows you the highlights of the upgrade and if there are things you should consider before upgrading to that version.

GitLab Upgrade Path Tool

Firstly, the version of the used GitLab is checked. The easiest way to do this is to go to your GitLab URL followed by /help.

GitLab Version Information

To see more detailed information about GitLab and related environment information, you can run the following command on your GitLab server.

sudo gitlab-rake gitlab:env:info
GitLab Environment Information

The Upgrade Process

To easily install the necessary updates from GitLab repository, the script below is run on the server.

curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash

During the GitLab upgrade process, automatic backup is taken, but it is still recommended to take manual backup as well. The following command is run for this process.

sudo gitlab-backup create
  • Also, you need to backup your configuration files manually because the backup Rake task GitLab provides does not store your configuration files.
  • At the very minimum, you must back up;
/etc/gitlab/gitlab-secrets.json

/etc/gitlab/gitlab.rb

Now, the upgrade process can be started by following the path provided by GitLab upgrade tool. We run the package installer command for our next desired version.


sudo apt-get install -y gitlab-ce=15.2.5-ce.0
Successful GitLab Upgrade

After the upgrade process is done, the command below is run to restart GitLab.

sudo gitlab-ctl restart
gitlab-ctl restart output

Health Check of the New Version

Now you can check your current version by going to GitLab URL/help

The command below is run to check if each component was set up correctly.

sudo gitlab-rake gitlab:check
Component Health Check

The command below runs through all possible encrypted values in the database, verifying that they are decryptable using the current secrets file.

sudo gitlab-rake gitlab:doctor:secrets
Decryription Check

After the upgrade, we also need to make sure that our background migrations and batched background migrations are done before upgrading to a newer version.

To check the background migrations status the following command is run;

sudo gitlab-rake db:migrate:status
Background Migrations

Check Batched Background Migrations by clicking;

  • On the top bar, Main menu > Admin.
  • On the left sidebar, Monitoring > Background Migrations.

All migrations must have a Finished status before upgrading GitLab to a newer version.

Batched Background Migrations In Queue
Finished Batched Background Migrations

At last, we run the following command to see the current state and uptime of each GitLab component.

sudo gitlab-ctl status
Running Processes

Congratulations !

Now you can use your GitLab in the latest version. Thank you for reading this guide, and have a good day !

References

Upgrading GitLab
GitLab Upgrade Path Tool
GitLab Maintenance Rake Tasks
GitLab Packages Repository

--

--