fix(gitlab): complete set of commands for restore

This commit is contained in:
Michele Cereda
2024-05-08 19:01:10 +02:00
parent 8d0d965a88
commit 6b35c735c9
2 changed files with 21 additions and 4 deletions

View File

@@ -138,8 +138,20 @@ sudo gitlab-backup create … \
SKIP='db,repositories,uploads,builds,artifacts,pages,lfs,terraform_state,registry,packages,ci_secure_files' SKIP='db,repositories,uploads,builds,artifacts,pages,lfs,terraform_state,registry,packages,ci_secure_files'
# Restore backups. # Restore backups.
sudo gitlab-ctl stop 'puma' \ sudo aws s3 cp 's3://backups/gitlab/gitlab-secrets.json' '/etc/gitlab/gitlab-secrets.json' \
&& sudo gitlab-ctl stop 'sidekiq' && sudo aws s3 cp 's3://backups/gitlab/gitlab.rb' '/etc/gitlab/gitlab.rb' \
&& sudo aws s3 cp \
's3://backups/gitlab/11493107454_2018_04_25_10.6.4-ce_gitlab_backup.tar' \
'/var/opt/gitlab/backups/' \
&& sudo gitlab-ctl stop 'puma' \
&& sudo gitlab-ctl stop 'sidekiq' \
&& sudo GITLAB_ASSUME_YES=1 gitlab-backup restore BACKUP='11493107454_2018_04_25_10.6.4-ce' \
&& sudo gitlab-ctl restart \
&& sudo gitlab-rake 'gitlab:check' SANITIZE=true \
&& sudo gitlab-rake 'gitlab:doctor:secrets' \
&& sudo gitlab-rake 'gitlab:artifacts:check' \
&& sudo gitlab-rake 'gitlab:lfs:check' \
&& sudo gitlab-rake 'gitlab:uploads:check'
# Upgrade the package. # Upgrade the package.
sudo yum check-update sudo yum check-update

View File

@@ -126,8 +126,13 @@ sudo aws s3 cp \
'/var/opt/gitlab/backups/' '/var/opt/gitlab/backups/'
sudo gitlab-ctl stop 'puma' sudo gitlab-ctl stop 'puma'
sudo gitlab-ctl stop 'sidekiq' sudo gitlab-ctl stop 'sidekiq'
sudo gitlab-backup restore BACKUP='11493107454_2018_04_25_10.6.4-ce' sudo GITLAB_ASSUME_YES=1 gitlab-backup restore BACKUP='11493107454_2018_04_25_10.6.4-ce'
sudo gitlab-ctl start sudo gitlab-ctl restart
sudo gitlab-rake 'gitlab:check' SANITIZE=true
sudo gitlab-rake 'gitlab:doctor:secrets'
sudo gitlab-rake 'gitlab:artifacts:check'
sudo gitlab-rake 'gitlab:lfs:check'
sudo gitlab-rake 'gitlab:uploads:check'
## Restore backups - end ------------- # ## Restore backups - end ------------- #