Upgrade 11.5.1-ee

upgrade from upgrade 11.5.1-ee fails

Im running Gitlab on Ubuntu 18.4.3
Im trying to upgrade to the latest version, Ive run apt-get update but Im getting an error that I need to upgrade to 11.11 first.
how do I upgrade to 11.11 specifically. I couldnt find the command or process in the documentation.

Probably with apt-get install gitlab-ee=11.11.8-ee.0, but it depends a bit on what you have done to make it possible to install/upgrade GitLab.

1 Like

thanks for answering.
what needs to be done to make it possible? can you explain?


if you are using the official package repository, older package versions exist. The command provided by @grove will allow you to install this specific version, instead of the latest 12.7.x at this time.

In case you are not sure what will happen in this regard, you can test-drive this in a local Docker container too.

michi@imagine ~ $ sudo docker run -ti ubuntu:bionic bash
root@d7ad48fe0b6b:/# apt-get update && apt-get -y install curl
root@d7ad48fe0b6b:/# curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh | bash

apt-get install gitlab-ee=11.11.8-ee.0 

Installation in a DMZ

You can also use this method to download the packages manually and then do a local install on your VM. This sometimes is required if you’re in a DMZ without internet access.

docker run -ti -v /tmp/gitlab:/tmp/gitlab ubunto:bionic bash

apt-get update && apt-get -y install curl
curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh | bash

apt-get clean
apt-get install --download-only -y gitlab-ee=11.11.8-ee.0

cp /var/cache/apt/archives/*.deb /tmp/gitlab/

Then copy the files from your host in /tmp/gitlab to the destination host, e.g. via rsync.

This method is inspired by a howto I wrote a while ago for the Icinga community.


1 Like

Hi Michael
I dont have docker here. gitlab is running on premise but it has access to the internet.
I ran the comand you mentioned. that is what Im gettings:

sudo gitlab-ctl stop
sudo apt-get install gitlab-ee=11.11.8-ee.0

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-4.15.0-39 linux-headers-4.15.0-39-generic linux-headers-4.15.0-72
  linux-headers-4.15.0-72-generic linux-image-4.15.0-39-generic linux-image-4.15.0-72-generic
  linux-modules-4.15.0-39-generic linux-modules-4.15.0-72-generic linux-modules-extra-4.15.0-39-generic
Use 'sudo apt autoremove' to remove them.
The following packages will be upgraded:
1 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
Need to get 737 MB of archives.
After this operation, 380 MB of additional disk space will be used.
Get:1 https://packages.gitlab.com/gitlab/gitlab-ee/ubuntu bionic/main amd64 gitlab-ee amd64 11.11.8-ee.0 [737 MB]
Fetched 737 MB in 8min 10s (1,505 kB/s)
(Reading database ... 257847 files and directories currently installed.)
Preparing to unpack .../gitlab-ee_11.11.8-ee.0_amd64.deb ...
gitlab preinstall:
gitlab preinstall: This node does not appear to be running a database
gitlab preinstall: Skipping version check, if you think this is an error exit now
gitlab preinstall:
gitlab preinstall: Automatically backing up only the GitLab SQL database (excluding everything else!)
Dumping database ...
Dumping PostgreSQL database gitlabhq_production ... pg_dump: [archiver (db)] connection to database "gitlabhq_production" failed: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/var/opt/gitlab/postgresql/.s.PGSQL.5432"?
rake aborted!
Backup::Error: Backup failed
/opt/gitlab/embedded/service/gitlab-rails/lib/backup/database.rb:49:in `dump'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/backup.rake:99:in `block (4 levels) in <top (required)>'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/backup.rake:10:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
Tasks: TOP => gitlab:backup:db:create
(See full trace by running task with --trace)
gitlab preinstall:
gitlab preinstall: Backup failed! If you want to skip this backup, run the following command and
gitlab preinstall: try again:
gitlab preinstall:
gitlab preinstall:   sudo touch /etc/gitlab/skip-auto-reconfigure
gitlab preinstall:
dpkg: error processing archive /var/cache/apt/archives/gitlab-ee_11.11.8-ee.0_amd64.deb (--unpack):
 new gitlab-ee package pre-installation script subprocess returned error exit status 1
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)


Docker was just meant to easily test this in a local sandbox. I use that on my macbook a lot to test-drive things before trying that out in production.

In your call, it says that the PostgreSQL database is not running, where I’d assume that your GitLab instance is stopped? The upgrade is trying to create a backup first.

If you want to skip the upgrade, do as proposed in the last message:

gitlab preinstall:
gitlab preinstall: Backup failed! If you want to skip this backup, run the following command and
gitlab preinstall: try again:
gitlab preinstall:
gitlab preinstall:   sudo touch /etc/gitlab/skip-auto-reconfigure
gitlab preinstall:

and start install again. If the above command doesn’t work, you can fix that with apt-get -f install.


Why are you completely stopping GitLab?

I believe the instructions as a maximum tell you to stop unicorn, sidekiq and puma - I always use the zero downtime procedure, which doesn’t require you to stop anything, so I might remember it wrongly.

1 Like

I stopped all gitlab services because I saw this as a 2nd step here
if there is a procedure to do it with zero downtime, can you please direct me there?
if I understand correctly I just need to run:
apt-get install gitlab-ee=11.11.8-ee.0
without stopping services before?


you are using the Omnibus packages, not a source installation. Therefore the linked docs are not valid for your setup. Just let GitLab be running and do the package installation.



For instructions about upgrading without downtime:
(might assume you use the omnibus package - but you do)


thanks dnsmichi&grove, I successfully upgraded to 11.11.8
will do some sanity check and continue with the upgrade.