版权声明:如需转载,请注明作者及出处 https://blog.csdn.net/qq_33317586/article/details/84347142
参考:https://blog.csdn.net/ouyang_peng/article/details/77070977
参考:https://docs.gitlab.com.cn/ee/raketasks/backup_restore.html
官方管理员文档:https://docs.gitlab.com.cn/ee/administration/index.html
官方文档对备份恢复讲的很详细,看不懂就翻译成中文
恢复要求前后版本一致
除了备份的包,还需要
一、修改备份文件的权限为777
root@gitlab:~# chmod 777 /var/opt/gitlab/backups/1542878975_2018_11_22_11.4.6-ee_gitlab_backup.tar
二、确保已经安装了gitlab
三、确保gitlab恢复的文件目录和/etc/gitlab/gitlab.rc中定义的目录一致
四、停止连接到数据库的进程,让剩下的gitlab运行
root@gitlab:~# gitlab-ctl stop unicorn
root@gitlab:~# gitlab-ctl stop sidekiq
root@gitlab:~# gitlab-ctl status
五、还原备份,指定要还原的备份的时间戳
root@gitlab:~# ls /var/opt/gitlab/backups/
1542878975_2018_11_22_11.4.6-ee_gitlab_backup.tar
root@gitlab:~# gitlab-rake gitlab:backup:restore BACKUP=1542878975_2018_11_22_11.4.6-ee
六、启动并检查Gitlab
root@gitlab:~# gitlab-ctl restart
root@gitlab:~# gitlab-rake gitlab:check SANITIZE=true
强烈建议去看官方文档,相当详细!