Upgrading to gitlab 12.x (upgrade to gitlab 13.x)

Note: Repository url and gpg signing key for personal repo of gitlab maintainer has changed.

Add transition repo which has gitlab 12.x,

deb https://people.debian.org/~praveen/gitlab-snapshots-12 buster-backports 
contrib main
deb https://people.debian.org/~praveen/gitlab-snapshots-12 buster-fasttrack 
contrib main

and setting up new signing key is explained in gitlab.

Now install gitlab 12.x,

# apt -t buster-backports install gitlab=12.10.7-1+fto10+2 \
gitaly/buster-backports gitlab-common/buster-backports \
ruby-gitlab-sidekiq-fetcher=0.5.2-1~bpo10+1 ruby-jira=1.7.1-1~bpo10+1 \
ruby-css-parser=1.6.0-1

At this point you should update gitlab to 13.x version available, following steps given at gitlab for buster-fasttrack (manually update ruby-bundler, ruby-molinillo and ruby-font-awesome-rails) and run apt dist-upgrade after gitlab is updated.

New repo is,

deb https://people.debian.org/~praveen/gitaly buster-backports contrib main
deb https://people.debian.org/~praveen/gitaly buster-fasttrack contrib main

Upgrading to buster (upgrade to gitlab 12.x)

You should first upgrade to 11.11.8 version before you can install newer versions.

Update /etc/apt/sources.list and change stretch to buster and add anew entry for buster-fasttrack and gitlab-snapshots (it is a repo created to provide exact versions required for updating from stretch to buster),

deb http://deb.debian.org/debian buster contrib main
deb http://security.debian.org/ buster/updates contrib main
deb https://people.debian.org/~praveen/gitlab buster-backports contrib main
deb https://people.debian.org/~praveen/gitlab-snapshots buster-backports contrib main
deb https://people.debian.org/~praveen/gitlab buster-fasttrack contrib main
deb http://deb.debian.org/debian buster-backports contrib main

If you get permission errors with /usr/share/gitlab/Gemfile.lock and /var/lib/gitlab/yarn-error.log, you can safely remove those two files.

If you get permission erros with /usr/share/gitlab/.bundle/config and /var/lib/gitlab/.ssh/authorized_keys change ownership of these files to gitlab user (if you chose a different user for gitlab, provide that name instead of gitlab)

# chown gitlab:gitlab /usr/share/gitlab/.bundle/config
# chown gitlab:gitlab /var/lib/gitlab/.ssh/authorized_keys

You may need to update postgresql-contrib package separately if you get errors related to postgresql service not running (make sure the new version is running on 5432 port). Use ss -aut command to list the running services.

Now update gitlab

# apt -t buster-backports install ruby-asciidoctor=1.5.8-1 asciidoctor=1.5.8-1
# apt -t buster-backports install gitlab gitaly=1.42.5+debian-1~bpo10+1 \
ruby-gitaly=1.37.0+dfsg-1~bpo10+1 ruby-default-value-for=3.1.1-3~bpo10+1 \
ruby-asciidoctor-plantuml=0.0.8-1 ruby-gitlab-sidekiq-fetcher=0.4.0-2~bpo10+1 \
ruby-asciidoctor=1.5.8-1 asciidoctor=1.5.8-1 ruby-prof=0.17.0+dfsg-3+b1 \
ruby-responders=2.4.0-3 ruby-task-list=2.2.0-1~bpo10+1 ruby-asana=0.8.1-2~bpo10+1 \
ruby-github-linguist=6.4.0-2 ruby-prometheus-client-mmap=0.9.4-1 \
ruby-grape=1.1.0-2 ruby-grape-path-helpers=1.1.0-1 node-css-loader=1.0.1-1 \
node-timeago.js=3.0.2+dfsg-3

ruby-grape package is missing some files so we need to install grape from rubygems.org But remember to remove this after ruby-grape is updated.

# gem install -v 1.1.0 grape

If you got some errors during "Running final rake tasks and tweaks..." step, you may have to remove some obsolete configuration files (especially if you installed gitlab from stretch for the first time),

rm /usr/share/gitlab/config/initializers/0_license.rb
rm /usr/share/gitlab/config/initializers/0_thread_cache.rb
rm /usr/share/gitlab/config/initializers/active_record_query_cache.rb
rm /usr/share/gitlab/config/initializers/elastic_client_setup.rb
rm /usr/share/gitlab/config/initializers/geo.rb
rm /usr/share/gitlab/config/initializers/load_balancing.rb
rm /usr/share/gitlab/config/initializers/transaction_metrics.rb

If gitlab installation failed at restarting services, you may need a restart.

If the installation failed at "Webpacking" stage, you can ignore the failure.

Now upgrade to gitlab 12.x following the instructions given above.

Stretch Backports (upgrade to buster)

Gitlab 11.4.9 is available in stretch-backports (still affected by some security issues, many security releases behind).

Gitlab 11.5.10 is available for stretch-backports via personal repo of gitlab maintainer (many security releases behind) from https://people.debian.org/~praveen/gitlab

Add to /etc/apt/sources.list

deb https://people.debian.org/~praveen/gitlab stretch-backports contrib main
deb http://deb.debian.org/debian stretch-backports contrib main

Add repo signing key as trusted,

# wget https://people.debian.org/~praveen/gitlab/praveen.key.asc
# apt-key add praveen.key.asc

Now install gitlab,

# apt -t stretch-backports install gitlab

If you got an error like yarn did not find a cache folder during installation, run this command

sudo -u gitlab mkdir -p /var/lib/gitlab/.cache/yarn/v4/

It is recommended to upgrade to buster to receive security updates (see above).

Note: Remove unnecessary packages after upgrade (remove ruby-bootsnap if you see strange load errors).

# apt remove rails npm ruby-bootsnap

Stretch (upgrade to stretch-backports and then to buster)

Gitlab 8.13.11 was available in stretch, but it was not receiving any security updates and was removed in a point release. So it is recommended to update to newer versions from stretch-backports (see above).

# apt install gitlab

It is recommended to upgrade to stretch-backports and then to buster to receive security updates.