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使 ...
随机推荐
- Windows11下的快捷键(win10通用,部分win11独有的不通用)
给大家介绍一下win11下我常用的几个快捷键,在微软官方的文档里面都可以查到,官网链接 https://support.microsoft.com/zh-cn/windows/windows-%E7% ...
- [gym102770L]List of Products
有一个很重要的性质:若$a\le b$且$c\le d$,则$ac\le bd$ 根据这一性质,就可以利用单调性$o(n)$求出小于$a_{x}\cdot b_{y}$的数的个数(先要对$a$和$b$ ...
- [bzoj5295]染色
将这张图化简,不断删掉度为1的点(类似于拓扑排序),构成了一张由环组成的图考虑一个连通块中,设点数为n,边数为m(已经删掉了度为1的点),那么一共只有三种情况:1.一个环($n=m$),一定为YES2 ...
- ASP .Net Core 在 CentOS8 ARM 下连接 SQL Server 2008 R2(Hypervisor)
本文主要记录在 ARM 系统下无法连接SQL Server 2008 R2 的解决过程. 解决方案是使用 ODBC 的方式连接数据库,进行操作. 手上有公司的华为鲲鹏云计算 ARM 架构的 CentO ...
- 使用 CSS 轻松实现一些高频出现的奇形怪状按钮
背景 在群里会有同学问相关的问题,怎么样使用 CSS 实现一个内切角按钮呢.怎么样实现一个带箭头的按钮呢? 本文基于一些高频出现在设计稿中的,使用 CSS 实现稍微有点难度和技巧性的按钮,讲解使用 C ...
- 【2020五校联考NOIP #6】三格缩进
题意: 给出 \(n\) 个数 \(a_1,a_2,\dots,a_n\),你要进行 \(m\) 次操作,每次操作有两种类型: \(1\ p\ x\):将 \(a_p\) 改为 \(x\). \(2\ ...
- Codeforces 288E - Polo the Penguin and Lucky Numbers(数位 dp+推式子)
题目传送门 似乎我的解法和官方题解不太一样 纪念自己独立做出来的一道难度 2800 的题. 我们记 \(ans(x)\) 为 \([444...44,x]\) 的答案,显然答案为 \(ans(r)-a ...
- Codeforces 626G - Raffles(贪心+堆)
题面传送门 考虑对于固定的彩票池 \(i\),我们假设现在押了 \(x\) 张彩票.利用差分的思想,从 \(x\) 张彩票变为 \(x+1\) 张时,期望的变化量 \(\Delta E=\dfrac{ ...
- 『学了就忘』Linux文件系统管理 — 61、使用parted命令进行分区
目录 1.parted命令介绍 2.parted交互模式 3.建立分区 (1)查看分区 (2)修改成GPT分区表 (3)建立分区 (4)建立文件系统(格式化) (5)调整分区大小 (6)删除分区 1. ...
- 生产调优2 HDFS-集群压测
目录 2 HDFS-集群压测 2.1 测试HDFS写性能 测试1 限制网络 1 向HDFS集群写10个128M的文件 测试结果分析 测试2 不限制网络 1 向HDFS集群写10个128M的文件 2 测 ...