A. Create a backup file
gitlab-rake gitlab:backup:create
Use the above command will create a similar name for the archive 1547087542_2019_01_10_11.0.3_gitlab_backup.tar of this archive is an integral part of the entire Gitlab in / var / opt / gitlab / backups directory, which is the beginning of the backups created 1547087542_2019_01_10_11.0.3 date
scp /var/opt/gitlab/backups/1547087542_2019_01_10_11.0.3_gitlab_backup.tar 192.168.61.28:/var/opt/gitlab/backups/
Target machine operation:
chmod 777 /var/opt/gitlab/backups/1547087542_2019_01_10_11.0.3_gitlab_backup.tar
gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq
gitlab-rake gitlab:backup:restore BACKUP=1547087542_2019_01_10_11.0.3
gitlab-ctl start
II scheduled backup:
Add regular tasks, two in the morning every day, perform a backup gitlab
0 2 * root /opt/gitlab/bin/gitlab-rake gitlab:backup:create CRON=1