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

相关推荐
angushine16 小时前
gitlab跨服务器备份
服务器·gitlab·github
蜡台1 天前
Git 常用配置:修改地址 ,提交模板配置
git·gitlab·template·git commit·gitbash
染夕陌木2 天前
极简教程:GitLab 上配置 SSH Key(附常见问题解决)
运维·ssh·gitlab
晨旭缘3 天前
GitLab CICD 中 K8s 部署:BOM 头与 YAML 格式全解
容器·kubernetes·gitlab
鳄鱼杆4 天前
服务器 | 2026年Ubuntu 24.04下GitLab Docker 企业级部署
服务器·ubuntu·gitlab
FreeBuf_5 天前
黑客滥用 GitHub 和 GitLab 托管恶意软件并实施凭证钓鱼攻击
gitlab·github
有理想的打工人8 天前
gitlab的参数设置与团队管理
gitlab
有理想的打工人8 天前
gitlab群组管理与ssh链接
ssh·gitlab
M-Ellen8 天前
从零搭建 Windows + WSL2 + Docker + GitLab CI/CD 完整手册
ci/cd·docker·gitlab
大脸胖柴8 天前
webStorm+gitLab操作学习
学习·gitlab·webstorm