備份
執行它即可
gitlab-rake gitlab:backup:create
預設是備到 /var/opt/gitlab/backups 底下
預設檔名為 1463469064_gitlab_backup.tar
如果要改路徑,在設定檔 /etc/gitlab/gitlab.rb 裡
# gitlab_rails['backup_path'] = "/var/opt/gitlab/backups"
還原
安裝與之前備份時相同版本的 Gitlab
yum install gitlab-ce-10.1.4-ce.0.el7.x86_64
不然它會說
Unpacking backup ... done GitLab version mismatch: Your current GitLab version (11.0.2) differs from the GitLab version in the backup! Please switch to the following version and try again: version: 10.1.4
停止 gitlab 的服務
gitlab-ctl stop unicorn gitlab-ctl stop sidekiq gitlab-ctl status
將要還原的備份檔放到 /var/opt/gitlab/backups/ 位置
1530366625_2018_06_30_10.1.4_gitlab_backup.tar
這個要指定某個備份檔時間 (timestamp) 進行還原
gitlab-rake gitlab:backup:restore BACKUP=1530366625_2018_06_30_10.1.4
可後面加上,就不用再自己手動 yes 了 (如果是新裝的話,就可以放心複蓋上去)
force=yes
啟動 gitlab
gitlab-ctl restart
Check GitLab
gitlab-rake gitlab:check SANITIZE=true
留言