寫在前面
Gitlab安裝的時候會有自動生成管理帳號,且在架設container的時候也會因為不同帳號而會有不同的管理與讀寫權限。因此如果要把A地的gitlab搬移到B地時,建議使用rsync連同整個資料夾的擁有者和權限都一起copy。用法是:
rsync -avp <origianl folder> <desc folder>
公司的Gitlab使用12.1.1-ce0使用了很久。準備要升級。
不過因為configure差異太多,沒辦法一步到位,所以必須要一版一版慢慢升上去。以下紀錄升版過程:
12.2.12-ce0
12.4.6-ce0
12.6.0--ce0
12.8.0-ce0
12.10.0-ce0
13.0.0-ce0
13.12.15-ce0
14.0.12-ce0
14.2.0-ce0
從14.2.0開始,在檔案系統有些許變革。所以需要進入到conainter裡面把檔案系統打開後再進行reconfigure(可參考: https://blog.csdn.net/OldDirverHelpMe/article/details/106536972 ),不然會卡在某個ruby_block的區段裡出不來。(後面有蠻多機會碰到這狀況的,但解法都一樣)
以下為參考指令:
sudo docker run -it -v `pwd`/config:/etc/gitlab -v `pwd`/data:/var/opt/gitlab gitlab/gitlab-ce:14.2.0-ce.0 bash
runsvdir-start &
gitlab-ctl reconfigure
升級成功後,再繼續往下走
14.3.1-ce.0
14.5.1-ce.0
14.7.1-ce.0
14.9.1-ce.0
14.9.5-ce.0
往14.10升級時會碰到migrate的問題,因此要進入14.10.2 的 container執行以下指令:
gitlab-rake gitlab:background_migrations:finalize[ProjectNamespaces::BackfillProjectNamespaces,projects,id,'[null\,"up"]']
gitlab-ctl reconfigure
14.10.2-ce.0
14.10.5-ce.0
15.0.0-ce.0
15.2.0-ce.0
15.4.0-ce.0
15.6.2-ce.0
Gitlab 官方建議升級方式
可參考: https://gitlab-com.gitlab.io/support/toolbox/upgrade-path/
沒有留言:
張貼留言