首页 > 其他 > 详细

gitlab4.0备份还原

时间:2018-11-10 18:25:09      阅读:218      评论:0      收藏:0      [点我收藏+]

一,备份

备份默认路径查看:

gitlab/config/gitlab.yml 中的backup: 默认tmp/backups ====》这个是gitlab/tmp/backups/  可不是系统的tmp/backups

技术分享图片

进入gitlab账户下执行备份命令

bundle exec rake gitlab:backup:create  ===>必须在Gemfile 所在的目录下执行

技术分享图片

 

如果备份报错

rake aborted!
cannot load such file -- rb-inotify
/home/gitlab/gitlab/config/application.rb:9:in `<top (required)>‘
/home/gitlab/gitlab/Rakefile:5:in `require‘
/home/gitlab/gitlab/Rakefile:5:in `<top (required)>

解决方案:

bundle exec rake assets:precompile RAILS_ENV=production  ==》生成资产标签

bundle exec rake gitlab:backup:create RAILS_ENV=production ===》指定环境变量

 二,迁移 

停止所有的gitlab服务:

service gitlab stop

pkill nginx

将备份文件放在新服务器的bakups目录下

备份文件权限修改为777:  chmod 777 xxxx

恢复:sudo -u gitlab -H bundle exec rake gitlab:backup:restore BACKUP=1541820252 RAILS_ENV=production

重启gitlab  nginx服务

 

gitlab4.0备份还原

原文:https://www.cnblogs.com/zy1234567/p/9937505.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!