Skip to content

1.备份 gitlab-ce 数据

bash
gitlab-rake gitlab:backup:create
gitlab-rake gitlab:backup:create

备份文件保存在/var/opt/gitlab/backups/目录下,使用工具将文件下载上传至目标服务器的/var/opt/gitlab/backups/目录

2.使用原 gitlab-ce 备份数据进行恢复

bash
cd /var/opt/gitlab/backups/
# 将权限修改为git用户
chown git 1551144361_2019_02_26_11.6.5_gitlab_backup.tar



#停止数据写入服务
gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq

#查看状态
gitlab-ctl status

# 执行还原操作
gitlab-rake gitlab:backup:restore BACKUP=1551144361_2019_02_26_11.6.5

#重启服务
 gitlab-ctl restart
cd /var/opt/gitlab/backups/
# 将权限修改为git用户
chown git 1551144361_2019_02_26_11.6.5_gitlab_backup.tar



#停止数据写入服务
gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq

#查看状态
gitlab-ctl status

# 执行还原操作
gitlab-rake gitlab:backup:restore BACKUP=1551144361_2019_02_26_11.6.5

#重启服务
 gitlab-ctl restart