在 Debian 上升级 GitLab(通常指 GitLab CE / EE Omnibus 包)是比较成熟的流程,下面按推荐顺序给你一份安全、可回滚的操作步骤。
gitlab-rake gitlab:env:info
或
dpkg -l | grep gitlab
gitlab-backup create
默认备份路径:
/var/opt/gitlab/backups
如需备份配置:
tar czf /root/gitlab-config-$(date +%F).tar.gz \
/etc/gitlab /var/opt/gitlab
lsb_release -a
GitLab 对 Debian 版本有要求,例如:
apt update
apt upgrade gitlab-ee
或(CE 版本)
apt upgrade gitlab-ce
如果提示依赖问题,可先:
apt --fix-broken install
⚠️ GitLab 不支持跨多个大版本直接升级
例如:
14.x → 15.x → 16.x → 17.x
apt-cache policy gitlab-ce
apt install gitlab-ce=16.11.5-ce.0
gitlab-ctl reconfigure
gitlab-ctl restart
检查状态:
gitlab-ctl status
gitlab-rake gitlab:check
gitlab-rake gitlab:env:info
gitlab-ctl restart
gitlab-ctl tail
gitlab-ctl pg-upgrade
df -h
du -sh /var/opt/gitlab
如果升级失败:
apt install gitlab-ce=<旧版本号>
gitlab-ctl reconfigure
✅ 最小停机升级流程
reconfigure如果你愿意,可以直接告诉我:
我可以给你精确到版本的升级路线 ✅