gitlab备份
默认备份目录 /var/opt/gitlab/backups/
备份配置文件
/etc/gitlab/gitlab.rb
/etc/gitlab/gitlab-secrets.json
gitlab停止数据服务
gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq
备份指令
//12.2以前
gitlab-rake gitlab:backup:create BACKUP=xxxxx
//12.2以后
gitlab-backup create BACKUP=xxxxx
复制备份文件到新环境
cp xxxxx /var/opt/gitlab/backups/xxxxx
恢复数据
#12.2以前
gitlab-rake gitlab:backup:restore BACKUP=xxxxx
#12.2以后
gitlab-backup restore BACKUP=xxxxx
替换gitlab.rb、gitlab-secrets.json 到新环境 /etc/gitlab下
cat gitlab.rb > /etc/gitlab/gitlab.rb
cat gitlab-secrets.json > /etc/gitlab/gitlab-secrets.json
重新加载配置
gitlab-rake reconfigure
恢复数据服务
gitlab-ctl start unicorn
gitlab-ctl start sidekiq
网友评论