1、安装必要依赖、打开防火想配置、配置支持邮件
依赖
sudo yum install -y curl policycoreutils-python openssh-server
打开防火墙和SSH
sudo systemctl enable sshd
sudo systemctl start sshd
sudo firewall-cmd --permanent --add-service=http
sudo systemctl reload firewalld
安装邮件支持
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix
2、下载包并安装
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash
sudo EXTERNAL_URL="http://对外地址" yum install -y gitlab-ee
直接访问即可:
修改相关配置:
cd /etc/gitlab/
vim gitlab.rb
sudo gitlab-ctl reconfigure
gitlab-ctl restart
2、gitlab的卸载,在准备迁移数据的过程发先,可能需要两个服务器版本相同才能迁移。
- 停止:
gitlab-ctl stop
- 卸载包,注意安装的版本:
rpm -e gitlab-ee
- 查看进程,干掉第一个带...
ps aux | grep gitlab
- 删除全部文件:
find / -name gitlab | xargs rm -rf
3、根据版本安装
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-11.4.8-ce.0.el7.x86_64.rpm
rpm -Uvh gitlab-ce-11.4.8-ce.0.el7.x86_64.rpm
4、同步数据
在原数据上导出数据:
gitlab-rake gitlab:backup:create RAILS_ENV=production
路径一般情况下都在:/var/opt/gitlab/backups
在新服务器上执行:
gitlab-rake gitlab:backup:restore RAILS_ENV=production BACKUP=1644915573_2022_02_15_11.4.8