码迷,mamicode.com
首页 > 其他好文 > 详细

gitlab人备份与恢复

时间:2017-02-07 19:21:59      阅读:213      评论:0      收藏:0      [点我收藏+]

标签:gitlab   pac   修改   root   linux系统   creat   backup   conf   ati   

 

注意新建备份目录是:/usr/local/src/repositories 属主和属组:

# ll -d repositories/
drwx------ 4 git root 4096 Feb  7 17:32 repositories/

修改配置文件:

vim /opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml
 ## Backup settings
  backup:
    #path: "/var/opt/gitlab/backups"   # Relative paths are relative to Rails.root (default: tmp/backups/)
    path: "/usr/local/src/repositories"   # Relative paths are relative to Rails.root (default: tmp/backups/)

有些linux系统是需要改此文件:/etc/gitlab/gitlab.rb

重启# gitlab-ctl restart

备份git:

# gitlab-rake gitlab:backup:create

恢复备份:

# gitlab-ctl stop unicorn
# gitlab-ctl stop sidekiq
# ls /usr/local/src/repositories/
1484140459_gitlab_backup.tar
# gitlab-rake gitlab:backup:restore BACKUP=1484140459
Unpacking backup ...
#如果数据迁移的话一定要保持gitlab的版本是一至,不然会报错!!!
# gitlab-ctl start

 

gitlab人备份与恢复

标签:gitlab   pac   修改   root   linux系统   creat   backup   conf   ati   

原文地址:http://www.cnblogs.com/bass6/p/6375448.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!