gitlab 备份和还原

1,修改gitlab的配置文件

vim /etc/gitlab/gitlab.rb

prometheus'enable' = false

alertmanager'enable' = false

node_exporter'enable' = false

redis_exporter'enable' = false

postgres_exporter'enable' = false

gitlab_exporter'enable' = false

prometheus_monitoring'enable' = false

##################################

#备份参数设置

##################################

#备份是否打开

gitlab_rails'manage_backup_path' = true

#备份目录地址路径

gitlab_rails'backup_path' = "/var/opt/gitlab/backups"

#备份的权限设置

gitlab_rails'backup_archive_permissions' = 0644

#备份保存时间,超过事件覆盖掉;

gitlab_rails'backup_keep_time' = 604800

2.重新生成各种服务的配置文件

gitlab-ctl reconfigure

3.创建一次备份

gitlab-rake gitlab:backup:create

使用以上命令会在/var/opt/gitlab/backups目录下创建一个名称类似为*backup.tar的压缩包,

gitlab仓库恢复

1.停止相关数据连接服务

gitlab-ctl stop unicorn

gitlab-ctl stop sidekiq

2 恢复gitlab仓库

cd /var/opt/gitlab/backups

gitlab-rake gitlab:backup:restore BACKUP=1537261122_2018_09_18_9.2.5

3.重回启动gitlab

gitlab-ctl start

相关推荐
考虑考虑4 小时前
git刷新远程分支列表
git·后端·gitlab
IT大白鼠7 天前
GitLab 未认证 RCE 应急实战CVE-2026-97229(CVSS 10.0)
网络·安全·gitlab
71777713 天前
Git自建用什么工具比较好:Gitea、Forgejo、GitLab CE与Gitee的选型对比
git·gitlab·gitea
colinu15 天前
Create gitlab-runner
gitlab
master33616 天前
GitLab 10.x → 19.5.x 升级路线图
gitlab
长不大的杨瑞杰17 天前
OpenCode v2 GitLab 集成实战:Issue 驱动开发、MR 审查与 CI/CD 最小权限
人工智能·ci/cd·gitlab·ai编程·opencode
极小狐22 天前
极狐GitLab万人并发架构实践,大规模组织的扩容路线图
架构·gitlab·极狐gitlab
Lvan的前端笔记23 天前
GitLab CI 环境变量整理
ci/cd·gitlab
李迟24 天前
CICD实例:解决GitLab Runner无法执行CICD问题
gitlab
hanjq_code1 个月前
gitlab本地文件 跨分支 忽略改动 不提交
gitlab