Update GitLab on Debian

Hello,
On Debian, I use the apt update && apt upgrade command to update GitLab and this will cause the GitLab components to be restarted after the update. Is this the right way? If someone is busy working with GitLab, then they will be disconnected!

Thank you.

The right way is to start with the Gitlab Upgrade docs: Upgrade GitLab | GitLab

Doing an apt update/upgrade, especially if you are on an old version will break your Gitlab installation. You will need to ensure to follow the Gitlab Upgrade path from the info linked above.

If you ensure your installation is always up-to-date by checking and applying updates weekly, then doing a simple apt update/upgrade as you mentioned will be fine. But as soon as you let your update strategy fall behind, that is the time when you need to pay attention to the Gitlab documentation.

Also ensure you have made a backup of your server before upgrading, just in case it goes wrong, since you will have something to restore from.

There’s literally hundreds of posts on this forum about updates/upgrades and following upgrade path, so I suggest searching, since you will see a load of info that will help you.

1 Like

Agreed on everything written by @iwalker

Additionally, I would advice to do this out of your users’ working hours to avoid any downtime and using GitLab Maintenance Mode if available (if you don’t have bigger architecture with blue/green deployments set up). This turns GitLab to Read Only mode so you can be sure your data won’t end up in a weird state if someone tries do to anything on GitLab during upgrades / basic maintenance.

1 Like

When @iwalker says “will be fine”, he just means that it’s very unlikely to break your GitLab installation. What he doesn’t mention is that it will still cause downtime (unless you have a setup with at least two load-balanced servers, but people who have that typically dosn’t ask such questions). As you explicitly mention somebody working with GitLab, you should think about that, and read what @paula.kokic wrote.

Even if you got the impression from @iwalker’s post that reading the upgrade guide isn’t necessary if you stay up-to-date it’s still a good idea.

You can reduce (but not eliminate) downtime when upgrading by following the guide’s description of (so-called, it’s actually a misnomer) “zero-downtime upgrades”.

1 Like

Hello,
Thank you so much for all replies.
The tier of most of these features are Premium and Ultimate.

Hello,
I get the following messages when updating:

2024-04-17 12:31:54 UTC -- Warning: Your gitlab.rb and gitlab-secrets.json files contain sensitive data
 
and are not included in this backup. You will need these files to restore a backup.
Please back them up manually.
2024-04-17 12:31:54 UTC -- Backup 1713357106_2024_04_17_16.10.1 is done.
2024-04-17 12:31:54 UTC -- Deleting backup and restore PID file ... done
gitlab preinstall: Automatically backing up /etc/gitlab
Running configuration backup
Creating configuration backup archive: gitlab_config_1713357116_2024_04_17.tar
/etc/gitlab/
/etc/gitlab/ssl/
/etc/gitlab/ssl/dhparam.pem
/etc/gitlab/gitlab-secrets.json
/etc/gitlab/trusted-certs/
/etc/gitlab/gitlab.rb
Configuration backup archive complete: /etc/gitlab/config_backup/gitlab_config_1713357116_2024_04_17.ta
r
Keeping all older configuration backups

Yep, that’s normal. You did read what it says in the warning message? Because it’s pretty clear what you need to do.

1 Like