gitlab人备份与恢复
注意新建备份目录是:/usr/local/src/repositories 属主和属组:
- # ll -d repositories/
- drwx------ git root Feb : 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=
- Unpacking backup ...
- #如果数据迁移的话一定要保持gitlab的版本是一至,不然会报错!!!
- # gitlab-ctl start
亲测:
- # grep 'backup' -C /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/)
- keep_time: # default: (forever) (in seconds)
- #可以看到备份后的数据路径为:/var/opt/gitlab/backups
- [root@GitLab backups]# pwd
- /var/opt/gitlab/backups
- [root@GitLab backups]# ls
- [root@GitLab backups]# gitlab-rake gitlab:backup:create
- Dumping database ...
- Dumping PostgreSQL database gitlabhq_production ... [DONE]
- done
- Dumping repositories ...
- * root/document ... [DONE]
- * root/document.wiki ... [SKIPPED]
- * ok/hx-it-doc ... [DONE]
- * ok/hx-it-doc.wiki ... [SKIPPED]
- done
- Dumping uploads ...
- done
- Creating backup archive: 1486695836_gitlab_backup.tar ... done
- Deleting tmp directories ... done
- Deleting old backups ... skipping
- [root@GitLab backups]# ls
- 1486695836_gitlab_backup.tar
- 数据还原:
- 把数据1486695836_gitlab_backup.tar 放到/var/opt/gitlab/backups中
- [root@GitLab src]# gitlab-ctl stop unicorn
- ok: down: unicorn: 1s, normally up
- [root@GitLab src]# gitlab-ctl stop sidekiq
- ok: down: sidekiq: 0s, normally up
- [root@GitLab backups]# pwd
- /var/opt/gitlab/backups
- [root@GitLab backups]# ls
- 1486695836_gitlab_backup.tar#注意这个文件的名子是在备份的时修生成的不能改变!!!!
- [root@GitLab backups]# gitlab-rake gitlab:backup:restore BACKUP= #数据版号1486695836_gitlab_backup.tar
- 下现在为止git数据恢复完成!!
gitlab人备份与恢复的更多相关文章
- gitlab的备份与恢复与迁移
一.gitlab的备份1.1 创建备份目录,并授权 1 2 3 4 [root@linux-node1 ~]# mkdir /data/backups/gitlab -p [root@linux-no ...
- GitLab数据备份与恢复
创建备份 $ sudo gitlab-rake gitlab:backup:create 执行完备份命令后会在/var/opt/gitlab/backups目录下生成备份后的文件,如150080913 ...
- docker安装的gitlab的备份与恢复
1.对docker容器安装gitlab备份 1) 查看容器id docker ps 2) 将容器备份成镜像文件 docker commit -a 'James' -m 'gitlab_backup' ...
- Git7:使用Gitlab管理远程仓库
目录 1.安装 2.gitlab基本配置 3.gitlab的邮件配置 3.1.使用本地的postfix发送邮件 3.2.使用邮件发送模板 3.3.使用腾讯企业邮箱配置发送邮件 3.4.使用163邮箱来 ...
- Gitlab服务器维护
一. 内容 Gitlab服务器的更新 Gitlab服务器备份与恢复 导入Git仓库 二. Gitlab服务器的更新 1. 使用SSH登陆Gitlab服务器 2. 停止后端的unicorn服务器 [ro ...
- ubuntu16部署gitlab
一.gitlab的安装 1. 安装依赖包 $ sudo apt-get update #如无ssh还需安装openssh-server $ sudo apt-get install postfix c ...
- gitlab升级备份
一.备份有关备份和恢复的操作,详见我的另一篇博客:Gitlab的备份与恢复在开始升级之前,一定要做好备份工作,并记录好版本号.1.查看当前Gitlab的版本号 [root@gitlab ~]# cat ...
- Github版本管理以及git使用
1.git客户端编译安装 同步系统时间服务器 ntpdate cn.ntp.org.cn 安装依赖包: [root@baolin ~]# yum install epel-release -y [ro ...
- gitlab多人协作开发
gitlab多人协同工作 本文为亨利向<Git权威指南>的作者蒋鑫老师的答疑邮件写成. 这里特别感谢蒋鑫老师对我询问gitlab的协同工作流程问题的详细解答. 蒋鑫老师的细致专业的解答让我 ...
随机推荐
- Hadoop,HBase集群环境搭建的问题集锦(二)
10.艾玛, Datanode也启动不了了? 找到log: Caused by: java.net.UnknownHostException: Invalid host name: local hos ...
- JS将数字转换为大写汉字人民币
<script language="jscript"> function convertCurrency(currencyDigits) { // Constants: ...
- 〖Windows〗zigbee实验之cygwin编译TestSimpleMac出错的解决方法
1. 错误代码如下: ... C51 COMPILER V8. - SN: K1CMC-IEYCYC COPYRIGHT KEIL ELEKTRONIK GmbH - *** ERROR C141 I ...
- Filezilla开源FTP传输工具
生于忧患,死于安乐!在进取中思考... 官网:https://filezilla-project.org/ #FileZilla截图 免费.开源的FTP链接工具! 云下载: http://pan.ba ...
- iOS支付宝支付集成
概述 iOS支付宝支付集成 详细 代码下载:http://www.demodashi.com/demo/10729.html 支付宝和微信都是业界的老大哥,相信大家都有所觉得文档.SDK都是各种坑吧( ...
- HDUOJ----2489 Minimal Ratio Tree
Minimal Ratio Tree Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Other ...
- HDUOJ-----4506小明系列故事——师兄帮帮忙
小明系列故事——师兄帮帮忙 Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Tot ...
- hdu--DFS
DFS Time Limit: 5000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submiss ...
- 仿京东左侧菜单 hover效果-简易demo
简单描述: 用到的知识点 css 中的绝对定位 以及 Js 中的事件冒泡(或事件委托) .cont{display:inline-block;width:200px;height:200px;bord ...
- PSQL_标准API和Interface基本的用法和比较(概念)
2014-01-05 Created By BaoXinjian