为了防止数据丢失,做备份gitlab服务器
# 查看当前的版本
cat /opt/gitlab/embedded/service/gitlab-rails/VERSION
# 下载gitlab
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-15.0.0-ce.0.el7.x86_64.rpm
# 卸载原有的rpm
rpm -e gitlab-ce-15.0.5-ce.0.el7.x86_64.rpm
# 安装
rpm -ivh gitlab-ce-15.0.0-ce.0.el7.x86_64.rpm
# 重新加载
gitlab-ctl reconfigure
# Gitlab数据备份
gitlab-rake gitlab:backup:create
# 生成目录
/var/opt/gitlab/backups
# 停止目标gitlab数据服务
gitlab-ctl stop unicorn
gitlab-ctl stop sidekiq
# 拷贝源gitlab的备份文件到目标服务器
scp xxxxxxxxxx
# 恢复操作(不加后缀或者加着都行)
gitlab-rake gitlab:backup:restore BACKUP=1684205552_2023_05_16_15.0.5
注意看着电脑,会提示输入yes
命令:gitlab-ctl restart
chmod -R 755 /var/log/gitlab
http://user@192.168.xxx.xxx:8005/group/project.git
# 密码:
root密码
正常情况下,只要你在源gitlab服务器提交代码,就回立马推送到目标gitlab服务器