gitlab之数据备份恢复

备份

#备份的时候,先通知相关人员服务要听 ,停止两个服务,并影响访问 root@ubuntu:
/opt/web1# gitlab-ctl stop unicorn ok: down: unicorn: 0s, normally up root@ubuntu:/opt/web1# gitlab-ctl stop sidekiq ok: down: sidekiq: 1s, normally up #:创建备份 root@ubuntu:/opt/web1# gitlab-rake gitlab:backup:create #:注意此处不会备份一下配置文件之类的 #:启动服务 root@ubuntu:/opt/web1# gitlab-ctl start

 

 

恢复
#:恢复也需要停止服务
root@ubuntu:/opt/web1# gitlab-ctl stop unicorn
ok: down: unicorn: 1s, normally up
root@ubuntu:/opt/web1# gitlab-ctl stop sidekiq
ok: down: sidekiq: 1s, normally up

#:恢复
root@ubuntu:/opt/web1# cd /var/opt/gitlab/backups/
root@ubuntu:/var/opt/gitlab/backups# ls
1569734081_2019_09_29_11.11.5_gitlab_backup.tar

root@ubuntu:/var/opt/gitlab/backups# gitlab-rake gitlab:backup:restore BACKUP=1569734081_2019_09_29_11.11.5   #:注意backup后只写到版本号

#:启动服务
root@ubuntu:/var/opt/gitlab/backups# gitlab-ctl start 

 

posted @ 2019-09-29 13:30  Linus小跟班  阅读(284)  评论(0编辑  收藏  举报