Files
minimal-setups/content/snippets/0070-gitlab-backup.md
Wolfgang Hottgenroth b2249c06e9
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
mdwiki test starts
2025-04-14 22:22:45 +02:00

1.3 KiB

Backup

Find the backup directory:

grep backup_path /etc/gitlab/gitlab.rb

Issue backup:

sudo gitlab-backup create

Transfer backup using scp to destination machine.

Backup configuration and secrets:

sudp cp /etc/gitlab/gitlab-secrets.json /backuppath/
sudo cp /etc/gitlab/gitlab.rb /backuppath/

Restore

See also here: https://docs.gitlab.com/ee/administration/backup_restore/restore_gitlab.html

DO NOT OVERWRITE THE CONFIGURATION ON THE DESTINATION MACHINE. COMPARE IT AND CONSIDER AND EVALUATE EACH DIFFERENCE

Stop processes of GitLab connecting to the database:

gitlab-ctl stop puma
gitlab-ctl stop sidekiq
# check
gitlab-ctl status

Do not stop the whole system since the restore tool has to connect to the database which would also stop in that case.

Issue restore. Run this command in a screen session. It is running quite long and requires manual intervention in between.

sudo gitlab-backup restore BACKUP=...

Use the datecode and the version tag of the backup created above.

Remember secrets and configuration. Do not overwrite configuration, see above.

Reconfigure the instance:

sudo gitlab-ctl reconfigure

Start the instance:

sudo gitlab-ctl start