Help us learn about your current experience with the documentation. Take the survey.
回退到早期 GitLab 版本
- Tier: Free, Premium, Ultimate
- Offering: GitLab Self-Managed
您可以将通过 Linux 包安装的 GitLab 实例回退到早期版本。
先决条件
因为您必须还原实例升级时所做的数据库架构更改(migrations),所以您必须拥有:
- 至少有一个与您要回退到的版本和版本完全相同的数据库备份。
- 理想情况下,有一个与您要回退到的版本和版本完全相同的完整备份存档。
当回退到早期主版本时,您必须考虑先前升级时发生的版本特定更改。有关更多信息,请参阅:
将 Linux 包实例回退到早期 GitLab 版本
要将 GitLab 回退到早期版本:
-
停止 GitLab 并移除当前包:
# If running Puma sudo gitlab-ctl stop puma # Stop sidekiq sudo gitlab-ctl stop sidekiq # If on Ubuntu: remove the current package sudo dpkg -r gitlab-ee # If on Centos: remove the current package sudo yum remove gitlab-ee -
确定您要回退到的 GitLab 版本:
# (Replace with gitlab-ce if you have GitLab FOSS installed) # Ubuntu sudo apt-cache madison gitlab-ee # CentOS: sudo yum --showduplicates list gitlab-ee -
将 GitLab 回退到所需版本(例如,回退到 GitLab 15.0.5):
# (Replace with gitlab-ce if you have GitLab FOSS installed) # Ubuntu sudo apt install gitlab-ee=15.0.5-ee.0 # CentOS: sudo yum install gitlab-ee-15.0.5-ee.0.el8 -
重新配置 GitLab:
sudo gitlab-ctl reconfigure -
恢复 GitLab 以完成回退。