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使 ...
随机推荐
- 面试官:咱们来聊一聊mysql主从延迟
背景 前段时间遇到一个线上问题,后来排查好久发现是因为主从同步延迟导致的,所以今天写一篇文章总结一下这个问题希望对你有用.如果觉得还不错,记得加个关注点个赞哦 思维导图 思维导图 常见的主从架构 随着 ...
- Android——ViewHolder的作用与用法
转载至:https://www.cnblogs.com/wugu-ren/p/6106379.htmlViewHolder通常出现在适配器里,为的是listview滚动的时候快速设置值,而不必每次都重 ...
- [zoj3990]Tree Equation
记$dep(T)$为树$T$的深度(根节点深度为0),则有$\begin{cases}dep(A+B)=\max(dep(A),dep(B))\\dep(A\cdot B)=dep(A)+dep(B) ...
- [atARC126F]Affine Sort
记$g(k)$为$c$恰为$k$的合法三元组数,显然$f(k)=\sum_{i=1}^{k}g(i)$ 结论:若$\lim_{k\rightarrow \infty}\frac{g(k)}{k^{2} ...
- [cf1168E]Xor Permutations
(与题目中下标不同,这里令下标为$[0,2^{k})$来方便运算) 根据异或的性质,显然有解的必要条件是$\bigoplus_{i=0}^{2^{k}-1}a_{i}=0$ 在此基础上,我们考虑构造- ...
- [loj2478]林克卡特树
原题等价于选择恰好$k+1$条不相交(无公共点)的路径使得边权和最大 证明:对于原题中的最优解,一定包含了k条0边权的边(否则可以将未使用的边删掉,然后将这条路径的末尾与不在同一个连通块内的点连边), ...
- react之react Hooks
函数组件,没有 class 组件中的 componentDidMount.componentDidUpdate 等生命周期方法,也没有 State,但这些可以通过 React Hook 实现. Rea ...
- 下一代的 3D Tiles 前瞻
下一代的 3D Tiles 前瞻 原文:Introducing 3D Tiles Next, Streaming Geospatial to the Metaverse 原文发布时间:2021年11月 ...
- 一类利用队列优化的DP
I.导入: 这是一个\(O(n^2)\)的状态和转移方程: \[f(i,j)=\left\{ \begin{aligned} f(i-1,j-1)+k \ (1\leq j)\\ \max_{k \i ...
- tcp可靠传输的机制有哪些(面试必看
一.综述 1.确认和重传:接收方收到报文就会确认,发送方发送一段时间后没有收到确认就重传. 2.数据校验 3.数据合理分片和排序: UDP:IP数据报大于1500字节,大于MTU.这个时候发送方IP层 ...