gitlab-ee 13.x->14.x->15.x->16.x升级踩坑记

安装-升级

升级时需要打开如下网址规划路径:
https://gitlab-com.gitlab.io/support/toolbox/upgrade-path/?current=13.3.9&distro=centos&auto=true
导入gitlab官方软件仓库
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash

自检查

gitlab-rake gitlab:check SANITIZE=true

列出后台是否存在正在运行的migration

gitlab-rake db:migrate:status
gitlab-rake db:migrate

备份

gitlab-rake gitlab:backup:create
ls /var/opt/gitlab/backups

恢复

cp ${tar} /var/opt/gitlab/bakcups/
gitlab-ctl stop unicorn
gitlab-ctl stop puma
gitlab-ctl stop sidekiq
gitlab-rake gitlab:backup:restore BACKUP=1704745822_2024_01_09_13.4.1-ee
gitlab-ctl reconfigure

卸载

gitlab-ctl stop
rpm -e gitlab-ee-${version}-ee.0.el8.x86_64.rpm
rm -rf /etc/gitlab
rm -rf /opt/gitlab
rm -rf /var/opt/gitlab
rm -rf /var/log/gitlab
rm -rf /run/gitlab

升级过程中遇到问题一般解决方案

1、数据库migrate失败(频率最高)

   查看caused by原因,手动解决问题后,执行:gitlab-rake db:migrate
   执行完毕后,输入:gitlab-rake db:migrate:status以查看迁移状态
  **注意:最好按提示one-by-one执行,即执行gitlab-rake db:migrate后看报错,然后解决报错,再执行gitlab-rake db:migrate,直到全部成功**
   全部迁移完成后下执行:gitlab-ctl reconfigure

2、提示restart某个组件以启用新版版本
按提示执行即可,也可全部重启,按个人喜好

3、升级过程中由于没有执行2,导致数据库migrate失败,启动组件超时
可以先重启gitlab: gitlab-ctl restart
若数据库迁移失败,参考问题1
若启动组件超时,重新配置即可:gitlab-ctl reconfigure
最后 重启gitlab: gitlab-ctl restart

升级到13.8.8遇到的问题

PG::DuplicateTable: ERROR: relation “public.postgres_indexes” already exists

sudo -u gitlab-psql /opt/gitlab/embedded/bin/psql -h /var/opt/gitlab/postgresql -d gitlabhq_production
DROP VIEW public.postgres_indexes;
exit;

PG::DuplicateTable: ERROR: relation “postgres_index_bloat_estimates” already exists

sudo -u gitlab-psql /opt/gitlab/embedded/bin/psql -h /var/opt/gitlab/postgresql -d gitlabhq_production
Drop view public.postgres_index_bloat_estimates;
exit;

最后

gitlab-ctl reconfigure

升级到14.3.6遇到的问题

Expected batched background migration for the given configuration to be marked
as ‘finished’, but it is ‘active’:
sudo gitlab-rake gitlab:background_migrations:finalize[CopyColumnUsingBackgroundMigrationJob,ci_builds,id,‘[[“id”, “stage_id”], [“id_convert_to_bigint”, “stage_id_convert_to_bigint”]]’]
Expected batched background migration for the given configuration to be marked as ‘finished’, but it is ‘active’: {:job_class_name=>“CopyColumnUsingBackgroundMigrationJob”, :table_name=>“ci_stages”, :column_name=>“id”, :job_arguments=>[[“id”], [“id_convert_to_bigint”]]}
Finalize it manualy by running

sudo gitlab-rake gitlab:background_migrations:finalize[CopyColumnUsingBackgroundMigrationJob,ci_stages,id,'[["id"]\, ["id_convert_to_bigint"]]']

Expected batched background migration for the given configuration to be marked as ‘finished’, but it is ‘active’: {:job_class_name=>“CopyColumnUsingBackgroundMigrationJob”, :table_name=>“ci_builds_metadata”, :column_name=>“id”, :job_arguments=>[[“id”], [“id_convert_to_bigint”]]}
Finalize it manualy by running

sudo gitlab-rake gitlab:background_migrations:finalize[CopyColumnUsingBackgroundMigrationJob,ci_builds_metadata,id,'[["id"]\, ["id_convert_to_bigint"]]']

Expected batched background migration for the given configuration to be marked as ‘finished’, but it is ‘active’: {:job_class_name=>“CopyColumnUsingBackgroundMigrationJob”, :table_name=>“push_event_payloads”, :column_name=>“event_id”, :job_arguments=>[[“event_id”], [“event_id_convert_to_bigint”]]}
Finalize it manualy by running

sudo gitlab-rake gitlab:background_migrations:finalize[CopyColumnUsingBackgroundMigrationJob,push_event_payloads,event_id,'[["event_id"]\, ["event_id_convert_to_bigint"]]']

migrate后需要执行

gitlab-ctl reconfigure

升级到14.9.5

gitlab-ctl restart

升级到15.4.6遇到的问题

大规模升级依赖

gitlab-ctl restart

升级到16.1.5遇到的问题

gitlab-ctl restart

升级到16.3.6遇到的问题

gitlab-ctl restart

升级到16.7.0遇到的问题

gitlab-ctl restart

相关推荐

  1. gitlab-ee 13.x->14.x->15.x->16.x升级

    2024-01-12 12:40:02       29 阅读
  2. React@16.x15)PureComponent 和 memo

    2024-01-12 12:40:02       9 阅读
  3. React@16.x19)事件的处理

    2024-01-12 12:40:02       11 阅读
  4. React@16.x18)错误边界

    2024-01-12 12:40:02       9 阅读
  5. React@16.x(23)useEffect

    2024-01-12 12:40:02       12 阅读
  6. React@16.x(26)useContext

    2024-01-12 12:40:02       9 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-01-12 12:40:02       16 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-01-12 12:40:02       16 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-01-12 12:40:02       15 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-01-12 12:40:02       18 阅读

热门阅读

  1. Git分支

    2024-01-12 12:40:02       37 阅读
  2. 439 - Knight Moves (UVA)

    2024-01-12 12:40:02       45 阅读
  3. Amessage的clear会清除对象并释放内存空间

    2024-01-12 12:40:02       30 阅读
  4. 数据结构---双向链表

    2024-01-12 12:40:02       39 阅读
  5. 灰色神经网络的回归分析

    2024-01-12 12:40:02       34 阅读
  6. MongoDB分片集群搭建

    2024-01-12 12:40:02       30 阅读