Hôm nay, Nim note lại một số thứ khi upgrade Gitlab.
Hiện tại thì mình cài gitlab trên Centos 7 từ rất lâu.
nên khi upgrade thì chỉ cần:yum update -y
KHi mình upgrade thì phá hiện 1 lỗi như dưới.
Updating : 32:bind-export-libs-9.11.4-26.P2.el7_9.13.x86_64 56/107 gitlab preinstall: It seems you are upgrading from major version 14 to major version 15. gitlab preinstall: It is required to upgrade to the latest 15.0.x version first before proceeding. gitlab preinstall: Please follow the upgrade documentation at https://docs.gitlab.com/ee/update/index.html#upgrade-paths error: %pre(gitlab-ce-15.9.2-ce.0.el7.x86_64) scriptlet failed, exit status 1 Error in PREIN scriptlet in rpm package gitlab-ce-15.9.2-ce.0.el7.x86_64 Updating : 1:grub2-2.02-0.87.0.2.el7.centos.11.x86_64 58/107 error: gitlab-ce-15.9.2-ce.0.el7.x86_64: install failed
Vì việc change 14 lên 15 sẽ gặp rất nhiều lỗi nên chúng ta cần phải upgrade manual.
Bạn cần access vào link sau để thực hiện check version cuối cùng của version 14.
https://docs.gitlab.com/ee/update/index.html#upgrade-paths

Mình thực hiện upgrade lên version 14.10.5
yum install gitlab-ce-14.10.5-ce.0.el7.x86_64
Khi upgrade thì thấy báo các lỗi sau:
Error executing action `run` on resource 'bash[migrate gitlab-rails database]'
Mình thấy hướng dẫn fix lỗi và run cách command bên dưới.
https://gitlab.com/gitlab-org/gitlab/-/issues/360377
gitlab-rake gitlab:background_migrations:finalize[ProjectNamespaces::BackfillProjectNamespaces,projects,id,'[null\,"up"]'] gitlab-rake db:migrate gitlab-ctl reconfigure apt dist-upgrade gitlab-ctl restart
Sau khi đã rum command ko bị lỗi gì thì chúng ta cùng run command bên dưới, để upgrade gitlab lên version cuối cùng của 14.
yum install gitlab-ce-14.10.5-ce.0.el7.x86_64
Nếu đã xong và bạn quyết định lên 15 thông qua command.yum update -y
bạn sẽ gặp lỗi bên dưới
Running transaction gitlab preinstall: It seems you are upgrading from major version 14 to major version 15. gitlab preinstall: It is required to upgrade to the latest 15.0.x version first before proceeding. gitlab preinstall: Please follow the upgrade documentation at https://docs.gitlab.com/ee/update/index.html#upgrade-paths error: %pre(gitlab-ce-15.8.2-ce.0.el7.x86_64) scriptlet failed, exit status 1 Error in PREIN scriptlet in rpm package gitlab-ce-15.8.2-ce.0.el7.x86_64 gitlab-ce-14.10.5-ce.0.el7.x86_64 was supposed to be removed but is not! Verifying : gitlab-ce-14.10.5-ce.0.el7.x86_64 1/2 Verifying : gitlab-ce-15.8.2-ce.0.el7.x86_64 2/2 Failed: gitlab-ce.x86_64 0:14.10.5-ce.0.el7 gitlab-ce.x86_64 0:15.8.2-ce.0.el7 Complete!
Mình đã dùng command lên bản đầu tiên của version 15.
yum install gitlab-ce-15.0.0-ce.0.el7.x86_64
repo gitlab: https://packages.gitlab.com/gitlab/gitlab-ce
xong khi xong thì mình run
yum update -y