diff --git a/howto/gitlab.md b/howto/gitlab.md index a64697ccbfa278cc85f7a84363374a29940883fe..c366d571b8de18dda71093c72a2e95845e6e6634 100644 --- a/howto/gitlab.md +++ b/howto/gitlab.md @@ -218,11 +218,43 @@ should be restored using the below procedure. ### Running an emergency backup -TBD +A full backup can be ran as root with: + + /usr/bin/gitlab-rake gitlab:backup:create + +Backups are stored as a tar file in `/srv/gitlab-backup` and do *not* +include secrets, which are backed up separately, for example with: + + umask 0077 && tar -C /var/opt/gitlab -czf /srv/gitlab-backup/config_backup$(date +"\%Y\%m\%dT\%H\%M").tar.gz + +See `/etc/cron.d/gitlab-config-backup`, and the `gitlab::backup` and +`profile::gitlab::app` classes for the actual jobs that runs nightly. ### baremetal recovery -TBD +Untested procedure extracted from the [upstream docs](https://docs.gitlab.com/ee/raketasks/backup_restore.html#restore-for-omnibus-gitlab-installations): + + 1. reinstall the same version you are restoring from + + 2. restore the secrets backup: + + tar -C /opt/gitlab/etc/ -x -v -z -f config_backup20200627T0200.tar.gz + + 2. configure and start gitlab: + + sudo gitlab-ctl reconfigure + sudo gitlab-ctl start + + 3. restore the file: + + sudo cp 11493107454_2018_04_25_10.6.4-ce_gitlab_backup.tar /var/opt/gitlab/backups + sudo chown git.git /var/opt/gitlab/backups/11493107454_2018_04_25_10.6.4-ce_gitlab_backup.tar + sudo gitlab-ctl stop unicorn + sudo gitlab-ctl stop puma + sudo gitlab-ctl stop sidekiq + # Verify + sudo gitlab-ctl status + sudo gitlab-backup restore BACKUP=11493107454_2018_04_25_10.6.4-ce # Reference