Upgrade from 13.5.4 to latest 14

I am running Version 13.5.4 on Debian 10. I am attempting to upgrade to the latest version and I am getting the following error message. I have gone into the documentation and could not seem to find any upgrade path from 13.5.4. How can I upgrade to the latest version?

root@gitlab01:/etc/gitlab# apt upgrade

Reading package lists… Done

Building dependency tree

Reading state information… Done

Calculating upgrade… Done

The following package was automatically installed and is no longer required:

linux-image-4.19.0-8-amd64

Use ‘apt autoremove’ to remove it.

The following packages will be upgraded:

gitlab-ce

1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

1 not fully installed or removed.

Need to get 0 B/963 MB of archives.

After this operation, 439 MB of additional disk space will be used.

Do you want to continue? [Y/n] y

Reading changelogs… Done

(Reading database … 122190 files and directories currently installed.)

Preparing to unpack …/gitlab-ce_14.4.0-ce.0_amd64.deb …

gitlab preinstall: It seems you are upgrading from major version 13 to major version 14.

gitlab preinstall: It is required to upgrade to the latest 14.0.x version first before proceeding.

gitlab preinstall: Please follow the upgrade documentation at Upgrading GitLab | GitLab

dpkg: error processing archive /var/cache/apt/archives/gitlab-ce_14.4.0-ce.0_amd64.deb (–unpack):

new gitlab-ce package pre-installation script subprocess returned error exit status 1

Errors were encountered while processing:

/var/cache/apt/archives/gitlab-ce_14.4.0-ce.0_amd64.deb

E: Sub-process /usr/bin/dpkg returned an error code (1)

root@gitlab01:/etc/gitlab#

Hi, the error explains the issue. You cannot upgrade from 13.5.4 directly to the latest. You have to go to a 14.0.x release first. The Gitlab docs link (Upgrading Gitlab | Gitlab) in the error message shows you the upgrade path to follow.

13.1.11 13.8.8 latest 13.12.Z latest 14.0.Z latest 14.Y.Z

so you should be upgrading to 13.8.8, then to 13.12.x, then to 14.0.x before going any further. I then suggest, that after 14.0.x, you upgrade to 14.1.x, 14.2.x, 14.3.x, and then to 14.4.x. So:

apt-get install gitlab-ce=13.8.8-ce.0
apt-get install gitlab-ce=13.12.12-ce.0
apt-get install gitlab-ce=14.0.11-ce.0
apt-get install gitlab-ce=14.1.7-ce.0
apt-get install gitlab-ce=14.2.5-ce.0
apt-get install gitlab-ce=14.3.3-ce.0
apt-get install gitlab-ce=14.4.0-ce.0

also, after each upgrade, and before starting the next you will need to check that background migrations have finished. This command will help:

gitlab-rails runner -e production 'puts Gitlab::BackgroundMigration.remaining'

so, you upgrade to 13.8.8 and run that command. Then when it reports 0 migrations, you can then upgrade to the next upgrade on the list. And repeat checking background migrations each and every time after the upgrade. It must be on zero before starting the next upgrade, else you can break your system. Make sure you also have a backup before starting in case something goes wrong.