Cannot restore gitlab after failed upgrade

What app is this about, and its version: Gitlab, 18.7.0~ynh1
What YunoHost version are you running: 12.1.39
What type of hardware are you using: Other ARM board

Describe your issue

Recently, I tried to upgrade my Gitlab instance and the upgrade failed. Sadly, the automatic backup could not be recovered. Neither could my regular borg backup. Both encounter the same error: GitLab version mismatch - Your current GitLab version (18.7.0) differs from the GitLab version in the backup! (which would be 18.8.4, according to the logs).
In the backup info, it is stated that the version is 18.0.7, but as I read the logs, actually the backed up version was 18.8.4, and 18.0.7 is the version that gets installed. This also tracks, as I keep my apps up to date, and version 18.7.0 was released last december, while 18.8.4 was released last month.
So I assume the backup script installs version 18.7.0, while 18.8.4 would be required, (the same version used in the backup, according to Gitlab). I have no idea how this could have happened.
As I understand it, I would have to manually change with version of Gitlab gets installed, so the backup can be restored and I can attempt the upgrade again. What would I need to change for that? Just the info.json?
Or is there an entirely different way I could try to solve this?

Thanks for your help!

Just for reference:
I also tried to just install a fresh Gitlab instance and restore my backup, as described on the restoration guide of Gitlab, but during the necessary downgrade, some database migration error occurred that I hardly even understand, so I am stuck with that path, too.

Share relevant logs or error messages

https://paste.yunohost.org/raw/xiyigedixi

Hi Melly,

How annoying!

What I would try:

  • make a copy of the current backup file to keep safe (I guess you have some projects there you’d like to keep)
  • download the backup file and extract it
  • there’s a script that tells how to restore the application

I had hoped the script installs a specific version, so that you could change the version there, recompress the backup, upload and run it again.

According to the log though, not a specific version is installed, just ‘gitlab-ynh-deps’:

2026-03-25 10:54:49,810: DEBUG - + dpkg-deb --build /tmp/tmp.YcqjbO4kz0/gitlab-ynh-deps /tmp/tmp.YcqjbO4kz0/gitlab-ynh-deps.deb
2026-03-25 10:54:49,863: DEBUG - + dpkg --force-depends --install /tmp/tmp.YcqjbO4kz0/gitlab-ynh-deps.deb
2026-03-25 10:54:49,864: DEBUG - + tee /tmp/tmp.YcqjbO4kz0/dpkg_log
2026-03-25 10:54:50,031: DEBUG - Selecting previously unselected package gitlab-ynh-deps.
2026-03-25 10:54:50,177: DEBUG - (Reading database ... 81156 files and directories currently installed.)
2026-03-25 10:54:50,193: DEBUG - Preparing to unpack .../gitlab-ynh-deps.deb ...
2026-03-25 10:54:50,199: DEBUG - Unpacking gitlab-ynh-deps (18.7.0~ynh1) ...
2026-03-25 10:54:50,254: DEBUG - Setting up gitlab-ynh-deps (18.7.0~ynh1) ...
2026-03-25 10:54:50,328: DEBUG - + _ynh_apt_install --fix-broken
2026-03-25 10:54:50,329: DEBUG - + _ynh_apt --no-remove --option Dpkg::Options::=--force-confdef --option Dpkg::Options::=--force-confold install --fix-broken
2026-03-25 10:54:50,330: DEBUG - + [[ --no-remove --option Dpkg::Options::=--force-confdef --option Dpkg::Options::=--force-confold install --fix-broken == \u\p\d\a\t\e ]]

Gitlab is a resatively complex package, I’m not familiar enough with either Gitlab or packaging to untangle it.

That was what I thought as well; which version does it install, as it seems your backed up database is 18.8.4, higher than 18.7.0, which it tries to install but lower than the fresh installation?

I finally found time to try some other things. Installing the Gitlab package installes the most recent available version, which is currently 18.10.1. So that does not work.
My next idea was to manually install an old version of Gitlab from the repo. So I downloaded the commit that updated to my target version (18.8.4) and zipped it. Then I installed the local zip file via the CLI. I had to tweak the installation script a little, because there was an error with a variable for Gitlab pages being unbound, so I just set it to false, as I don’t need it for the restoration. Then I zipped everything again and was able to successfully install it. I then followed the restoration process described by Gitlab.
Next I am going export all projects so I have a backup that is version independent for the next steps (in case something does not go as planned). My general Gitlab configurations are probably lost, but that does not matter too much, as long as my projects are saved!
I will then upgrade the Gitlab application. I am unsure whether I should reinstall Gitlab from the official repo afterwards (which would require me to backup and restore my projects again, but at the correct version this time). Maybe I’ll do it, just to be sure.

Thank you very much for your help!