Because my old gitlab server is broken I’m trying to setup a new server. To be able to restore the backups I have to install version 12.9.2 first and then upgrade to the current version.
I planned to do the following update path by installing first version 12.9.2, restoring the backups and then running apt-get install gitlab-ce=[next_version]
Do you know what command I have to run to add the missing resources / packages / lists?
Is it basically possible to install version 12.9.2 on Ubuntu 20.04 LTS?
That’s probably because it doesn’t exist for Ubuntu 20.04:
best bet, edit /etc/apt/sources.list.d/gitlab_gitlab-ce.list and replace focal with bionic and then install 12.9.2 and continue with your upgrade process after that. Once you get to 13.2.x you can then edit the file again and change bionic back to focal.
Hi Ian,
Thank you very much for your reply and sorry for my late answer!
I tried to edit the /etc/apt/sources.list.d/gitlab_gitlab-ce.list with the following command
sed -i ‘s/focal/bionic/g’ /etc/apt/sources.list.d/gitlab_gitlab-ce.list
and made apt-get update afterwards. Unfortunatelly this did not work our eighter
But your answer helps me a lot. I’ll do the following:
Hi Ian and everyone,
Please find attached all commands I used to restore my gitlab instance:
# Install gitlab with same version for which backups have been made (here 12.9.2. on Ubuntu 18.04)
# install required packages
apt-get install -y curl openssh-server ca-certificates tzdata perl
# add repo url
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
# install gitlab with specific version
EXTERNAL_URL="https://gitlab.MYDOMAIN.de" apt-get install gitlab-ce=12.9.2-ce.0
# Copy backups from backup server to gitlab server
# login to backup server
ssh user@backup.MYDOMAIN.de
# go to backup dir
cd /home/user/backups
# copy backup to new git server
scp [lastbackupfile] user@gitlab.MYDOMAIN.de:/home/user/
# restore backups
# login to new server
ssh user@gitlab.MYDOMAIN.de
su
# switch to directory of backups
cd /home/user/
# unpack backup
tar -xvzf ./20211016_gitlab_backup.tar.gz
# copy backup to default backup location
cp ./home/user/gitlab_backup/1634338897_2021_10_16_12.9.2_gitlab_backup.tar /var/opt/gitlab/backups/
# change user
chown git.git /var/opt/gitlab/backups/1634338897_2021_10_16_12.9.2_gitlab_backup.tar
# stop services
gitlab-ctl stop puma
gitlab-ctl stop sidekiq
# check if services have been stopped
gitlab-ctl status
# restore backup
gitlab-backup restore BACKUP=1634338897_2021_10_16_12.9.2
# restore gitlab-secrets file
cp ./home/user/gitlab_backup/gitlab-secrets.json /etc/gitlab/gitlab-secrets.json
# reconfigure gitlab
gitlab-ctl reconfigure
# restart everything
gitlab-ctl restart
# check gitlab
gitlab-rake gitlab:check SANITIZE=true