gitlab 备份&恢复
Gitlab 成功运行起来之后,最终的事情就是定期的备份,遇到问题后的还原。
备份配置
默认 Gitlab 的备份文件会创建在/var/opt/gitlab/backups文件夹中,格式为时间戳_日期_版本号_gitlab_backup.tar,例如:1515031353_2018_01_04_10.3.2_gitlab_backup.tar。
修改备份文件夹,需要修改配置文件/etc/gitlab/gitlab.rb中的:
gitlab_rails['backup_path'] = '/your_wish/backups'
然后gitlabctl-reconfigure生效。
手动备份
命令:gitlab-backup create
For GitLab 12.1 and earlier, use
gitlab-rake gitlab:backup:create
会在命令执行的时间点,在你配置的文件夹或者默认文件夹创建一个备份文件。
自动备份
0 2 * * * /opt/gitlab/bin/gitlab-backup create CRON=1
备份恢复
First make sure your backup tar file is in the backup directory described in the gitlab.rb configuration gitlab_rails['backup_path']. The default is /var/opt/gitlab/backups. It needs to be owned by the git user.
cp 11493107454_2018_04_25_10.6.4-ce_gitlab_backup.tar /var/opt/gitlab/backups/
chown git.git /var/opt/gitlab/backups/11493107454_2018_04_25_10.6.4-ce_gitlab_backup.tar
Stop the processes that are connected to the database. Leave the rest of GitLab running:
gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq
# Verify
gitlab-ctl status
Next, restore the backup, specifying the timestamp of the backup you wish to restore:
# This command will overwrite the contents of your GitLab database!
gitlab-backup restore BACKUP=1493107454_2018_04_25_10.6.4-ce
For GitLab 12.1 and earlier, use
gitlab-rake gitlab:backup:restore
Next, restore /etc/gitlab/gitlab-secrets.json if necessary as mentioned above.
Reconfigure, restart and check GitLab:
gitlab-ctl reconfigure
gitlab-ctl restart
gitlab-rake gitlab:check SANITIZE=true
If there is a GitLab version mismatch between your backup tar file and the installed version of GitLab, the restore command will abort with an error. Install the correct GitLab version and try again.
gitlab 备份&恢复的更多相关文章
- gitlab备份恢复
1.Gitlab 创建备份1.1 创建备份文件 首先我们得把老服务器上的Gitlab整体备份,使用Gitlab一键安装包安装Gitlab非常简单, 同样的备份恢复与迁移也非常简单. 使用一条命令即可创 ...
- gitlab之六: gitlab 备份恢复
参考: https://blog.csdn.net/ouyang_peng/article/details/77070977 备份: 所有的权限,库文件等信息全部备份到的 不更改备份目录的话: v ...
- gitlab备份、恢复、升级
1.备份 gitlab的备份很简单,只要使用命令: gitlab-rake gitlab:backup:create 即可将当前的数据库.代码全部备份到/var/opt/gitlab/backups ...
- Gitlab安装与备份恢复
GitHub是2008年由Ruby on Rails编写而成,与业界闻名的Github类似;但要将代码上传到GitHub上面,而且将项目设为私有还要收费.GitLab是一个用于仓库管理系统的开源项目, ...
- gitlab备份及恢复
gitlab备份步骤 https://blog.csdn.net/qq_31666147/article/details/79844107 gitlab版本 下载地址 https://mirrors ...
- Gitlab备份和恢复操作记录
前面已经介绍了Gitlab环境部署记录,这里简单说下Gitlab的备份和恢复操作记录: 1)Gitlab的备份目录路径设置 [root@code-server ~]# vim /etc/gitlab/ ...
- 转载:Gitlab备份和恢复操作记录
转载:Gitlab备份和恢复操作记录 包含了备份和数据恢复的操作记录,实验可行 前面已经介绍了Gitlab环境部署记录,这里简单说下Gitlab的备份和恢复操作记录: 1)Gitlab的备份目录路径设 ...
- 使用Gitlab一键安装包后的日常备份恢复与迁移
Gitlab 创建备份 使用Gitlab一键安装包安装Gitlab非常简单, 同样的备份恢复与迁移也非常简单. 使用一条命令即可创建完整的Gitlab备份: gitlab-rake gitlab:ba ...
- GitLab备份的创建与恢复
使用Gitlab一键安装包安装Gitlab非常简单, 同样的备份恢复与迁移也非常简单. 使用一条命令即可创建完整的Gitlab备份: gitlab-rake gitlab:backup:create使 ...
随机推荐
- (数据科学学习手札131)pandas中的常用字符串处理方法总结
本文示例代码及文件已上传至我的Github仓库https://github.com/CNFeffery/DataScienceStudyNotes 1 简介 在日常开展数据分析的过程中,我们经常需要对 ...
- 96-00年CPU功耗感知调度研究
最近读了一些1996-2000年的通过调度来降低cpu能耗的文章,主要文章有[1] [2] [3] [4] [5], 简单总结一些该时期单核CPU功耗感知的调度策略. 该时期还出现了很多关于低功耗电路 ...
- X-MagicBox-820的luatOS之路连载系列2
这块MagicBox小巧但外设丰富,盖板上的小液晶屏竟有240*240的分辨率.点亮后若是用最小字体,真有看瞎老王的不瞎之眼之势. 这种屏在某宝也是比较多的,大概就是长这样子: 我们这个820的盖板上 ...
- [bzoj2789]Letters
考虑A中第i次出现的j字符,最终位置一定是在B中第i次出现的j字符的位置,然后即求逆序对数量,cdq/线段树即可 1 #include<bits/stdc++.h> 2 using nam ...
- [SQL Server]一列多行转换为字符串
在 SQL Server 中,如何将多行数据变成一个字符串保存. skill 投石 挖矿 刮痧 上面三行数据想要得到结果为:投石,挖矿,刮痧 有两种方式: 拼接字符串. 使用 for XML 首先创建 ...
- pycurl报错: ImportError: pycurl: libcurl link-time ssl backend (openssl) is different from compile-time ssl backend
报错: ImportError: pycurl: libcurl link-time ssl backend (openssl) is different from compile-time ssl ...
- [Ocean Modelling for Begineers] Ch4. Long Waves in a Channel
Ch4. Long Waves in a Channel 简介 本章主要介绍明渠中分层流体模拟.练习包括浅水表面波,风暴潮.内波和分层流体模拟. 4.1 有限差分法详细介绍 4.1.1 泰勒公式 4. ...
- 【GS模型】使用R包sommer进行基因组选择的GBLUP和RRBLUP分析?
目录 简介 GS示例代码 简介 R包sommer内置了C++,运算速度还是比较快的,功能也很丰富,可求解各种复杂模型.语法相比于lme4包也要好懂一些. 建议查看文档:vignette("v ...
- bwa比对软件的使用以及其结果文件(sam)格式说明
一.bwa比对软件的使用 1.对参考基因组构建索引 bwa index -a bwtsw hg19.fa # -a 参数:is[默认] or bwtsw,即bwa构建索引的两种算法,两种算法都是 ...
- Spark3学习入门【基于Java】
Spark 是离线数据处理的一种大数据技术,和Flick相比数据处理要延后,因为Flick是实时数据处理,而Spark需要先读取数据到内存. Spark的库是基于Scala写的,虽然Scala也是运行 ...