mdwiki test starts
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2025-04-14 22:22:45 +02:00
parent 5c7ee2266a
commit b2249c06e9
143 changed files with 8463 additions and 215 deletions

View File

@ -0,0 +1,61 @@
<!--
title: Gitlab Backup and Restore
-->
## 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](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
```