生产环境的 GitLab 版本比较老,计划升级到最新版本,以下为测试步骤。
操作系统版本:CentOS 6.7 x86_64
GitLab 版本:7.14.1 升级到 8.17.3
安装 GitLab 7.14.1
关闭 selinux 和 iptables 。
1 | setenforce 0 |
添加 163 YUM 源 。
1 | rename .repo .bak /etc/yum.repos.d/*.repo |
安装 GitLab 所需依赖。
1 | yum install curl openssh-server openssh-clients postfix cronie |
安装 GitLab 7.14.1。
1 | rpm -ivh gitlab-ce-7.14.1-ce.0.el6.x86_64.rpm |
导入 GitLab 数据
拷贝生产环境的 GitLab 备份到 /var/opt/gitlab/backups/
目录。
1 | 1489612446_gitlab_backup.tar |
还原 GitLab 数据。
1 | gitlab-ctl stop unicorn |
升级 GitLab 版本
因为 GitLab 官网下载速度慢,所以添加清华大学 GitLab 的 YUM 源 进行安装。
1 | cat gitlab-ce.repo |
yum 更新缓存。
1 | yum makecache fast |
发现下载速度不够快,尝试更换 DNS 解决。
1 | cat /etc/resolv.conf |
升级 GitLab 版本到 8.17.3 。
1 | yum update gitlab-ce.x86_64 |
升级完成后,登录新版的 GitLab 进行测试,没有问题。