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

相关推荐
向往风的男子8 小时前
【devops】devops-gitlab之部署与日常使用
运维·gitlab·devops
soaring01218 小时前
Gitlab实现多项目触发式自动CICD
pipeline·gitlab·triggers·access tokens
cn_newer15 小时前
gitlab/极狐-离线包下载地址
gitlab·devops·极狐·离线包下载
Roc-xb2 天前
Centos7安装gitlab-ce(rpm安装方式)
centos·gitlab
慕羽★2 天前
Git常用指令整理【新手入门级】【by慕羽】
linux·git·ubuntu·gitlab·github·仓库·分布式协作
心之所想,行之将至3 天前
记录一下gitlab社区版的安装教程
linux·服务器·gitlab
极小狐3 天前
2024 年 GitLab Global DevSecOps 报告解读
gitlab·devsecops·devops·极狐gitlab·安全合规
极小狐3 天前
极狐GitLab DevSecOps 功能合集(七大安全功能)
安全·gitlab·devsecops·极狐gitlab·安全合规
iRayCheung3 天前
Gitlab pre-receive hooks适配java p3c-pmd和python pycodestyle
java·python·gitlab·pre-receive
极小狐3 天前
如何用 Helm Chart 安装指定版本的 GitLab Runner?
gitlab·devsecops·devops·极狐gitlab·安全合规