极狐gitlab从Docker迁移到 Helm

官网迁移文档

从 Helm Chart 迁移到 Linux 包 | 极狐GitLab

 

环境版本

Docker

Mino

Helm

Gitlab

registry.gitlab.cn/omnibus/gitlab-jh:14.8.2

latest

jh-gitlab-5.9.2

14.8.2

docker容器使用官方的 Omnibus GitLab 包

 

详细的迁移步骤可以参考官方文档

从 Helm Chart 迁移到 Linux 包 | 极狐GitLab

 

以下是迁移遇到问题解决

Restoring PostgreSQL database gitlabhq_production ... ERROR: must be owner of extension pg_trgm
ERROR: must be owner of extension btree_gist
ERROR: must be owner of extension btree_gist
ERROR: must be owner of extension pg_trgm

官网解释:

Restore GitLab | GitLab

lib/backup/database.rb · 626397fd57ea432a217e0c3b6b6fc8e0b6575e14 · GitLab.org / GitLab · GitLab

官网回答:尽管出现这些警告消息,但备份仍已成功恢复。

 

如果你是个完美主义者,不希望有报错警告。那就备份时跳过db,手动同步postgre数据

root@debian:/tmp# gitlab-backup create SKIP=db

...
...
Creating backup archive: 1733303665_2024_12_04_14.8.2-jh_gitlab_backup.tar ... done
Uploading backup archive to remote storage  ... skipped
Deleting tmp directories ... done
Deleting old backups ... skipping
Warning: Your gitlab.rb and gitlab-secrets.json files contain sensitive data 
and are not included in this backup. You will need these files to restore a backup.
Please back them up manually.
Backup task is done.

 

docker环境备份pg
su - gitlab-psql

#不推荐 /opt/gitlab/embedded/bin/pg_dump -h '/var/opt/gitlab/postgresql' gitlabhq_production > /var/opt/gitlab/postgresql/bak/gitlabhq_production.sql

/opt/gitlab/embedded/bin/pg_dump -h '/var/opt/gitlab/postgresql' -Fc gitlabhq_production > /var/opt/gitlab/postgresql/gitlabhq_production.dump
k8s环境导入pg,密码在configmap里
kubectl exec -it tj-alilong-postgresql-0 -n devops
pg_restore -U postgres -d gitlabhq_production --clean gitlabhq_production.dump
导入跳过db的备份数据
git@tj-yst-toolbox-9cbbd5dd-9424h:/srv/gitlab/tmp$ backup-utility --restore -f file:///srv/gitlab/tmp/1733131624_2024_12_02_14.8.2-jh_gitlab_backup.tar

Downloading from file:///srv/gitlab/tmp/1733303665_2024_12_04_14.8.2-jh_gitlab_backup.tar
################################################################################################################### 100.0%
Unpacking backup
....
....
....
....

2024-12-04 06:42:14 +0000 -- done
2024-12-04 06:42:28 +0000 -- Restoring builds ...
2024-12-04 06:42:28 +0000 -- done
Backup tarball not from a Helm chart based installation. Not processing files in object storage.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值