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

相关推荐
HIT_Weston10 小时前
63、【Ubuntu】【Gitlab】拉出内网 Web 服务:Gitlab 配置审视(七)
前端·ubuntu·gitlab
HIT_Weston14 小时前
65、【Ubuntu】【Gitlab】拉出内网 Web 服务:Gitlab 配置审视(九)
前端·ubuntu·gitlab
victory043116 小时前
GitLab部署报告
gitlab
HIT_Weston16 小时前
64、【Ubuntu】【Gitlab】拉出内网 Web 服务:Gitlab 配置审视(八)
前端·ubuntu·gitlab
HIT_Weston16 小时前
62、【Ubuntu】【Gitlab】拉出内网 Web 服务:Gitlab 配置审视(六)
前端·ubuntu·gitlab
不爱吃米饭_1 天前
Gitea 轻量级的Git方案 - Gitlab的替代品
git·gitlab·gitea
嘻哈baby2 天前
自建GitLab与CI/CD实战:团队协作完整方案
ci/cd·gitlab
秦时明月天明2 天前
GitLab SSH Key 过期:git pull failed : remote your ssh key has expired
git·ssh·gitlab
极限实验室2 天前
程序员爆哭!我们让 COCO AI 接管 GitLab 审查后,团队直接起飞:连 CTO 都说“这玩意儿比人靠谱多了
人工智能·gitlab
HIT_Weston3 天前
61、【Ubuntu】【Gitlab】拉出内网 Web 服务:Gitlab 配置审视(五)
前端·ubuntu·gitlab