gitlab+jenkins 之gitlab备份恢复

gitlab 备份与恢复

停止数据服务

  • gitlab-ctl stop unicorn
  • gitlab-ctl stop sidekiq

创建备份

  • gitlab-rake gitlab:backup:create
  • 查看备份目录: ls /var/opt/gitlab/backups/

开启服务后删除测试数据

  • gitlab-ctl start
  • 删除数据后停止数据服务
  • gitlab-ctl stop unicorn
  • gitlab-ctl stop sidekiq

备份恢复

  • 选择之前的备份的版本进行恢复(复制的时候删除中间的斜线)
  • 具体格式: gitlab-rake gitlab:ackup:restore BACKUP=unix时间戳_年_月_日_版本
  • 输入两次yes 之后数据就还原了

启动服务

  • gitlab-ctl start unicorn
  • gitlab-ctl start sidekiq
原文地址:https://www.cnblogs.com/Justin0717/p/12662549.html