Help us learn about your current experience with the documentation. Take the survey.
从企业版降级到社区版
您可以将企业版(EE)实例降级回社区版(CE),但必须先完成以下步骤:
- 禁用 EE 专用的认证机制。
- 从数据库中移除 EE 专用的集成。
- 调整使用环境范围的配置。
关闭 EE 专用的认证机制
Kerberos 仅在企业版实例中可用。您必须:
- 在降级前关闭这些机制。
- 为用户提供其他认证方式。
从数据库中移除 EE 专用的集成
这些集成仅在 EE 代码库中可用:
如果您降级到 CE,可能会遇到类似以下的错误:
Completed 500 Internal Server Error in 497ms (ActiveRecord: 32.2ms)
ActionView::Template::Error (The single-table inheritance mechanism failed to locate the subclass: 'Integrations::Github'. This
error is raised because the column 'type_new' is reserved for storing the class in case of inheritance. Please rename this
column if you didn't intend it to be used for storing the inheritance class or overwrite Integration.inheritance_column to
use another column for that information.)错误信息中的 subclass 可能是以下任何一种:
Integrations::GithubIntegrations::GitGuardianIntegrations::GoogleCloudPlatform::ArtifactRegistryIntegrations::GoogleCloudPlatform::WorkloadIdentityFederation
所有集成都会为您的每个项目自动创建。 为了避免此错误,您必须从数据库中删除所有 EE 专用的集成记录。
sudo gitlab-rails runner "Integration.where(type_new: ['Integrations::Github']).delete_all"
sudo gitlab-rails runner "Integration.where(type_new: ['Integrations::GitGuardian']).delete_all"
sudo gitlab-rails runner "Integration.where(type_new: ['Integrations::GoogleCloudPlatform::ArtifactRegistry']).delete_all"
sudo gitlab-rails runner "Integration.where(type_new: ['Integrations::GoogleCloudPlatform::WorkloadIdentityFederation']).delete_all"bundle exec rails runner "Integration.where(type_new: ['Integrations::Github']).delete_all" production
bundle exec rails runner "Integration.where(type_new: ['Integrations::GitGuardian']).delete_all" production
bundle exec rails runner "Integration.where(type_new: ['Integrations::GoogleCloudPlatform::ArtifactRegistry']).delete_all" production
bundle exec rails runner "Integration.where(type_new: ['Integrations::GoogleCloudPlatform::WorkloadIdentityFederation']).delete_all" production调整使用环境范围的配置
如果您使用 环境范围,可能需要调整配置,特别是当配置变量共享相同的键但具有不同范围时。 在 CE 中,环境范围会被完全忽略。
对于共享相同键但具有不同范围的配置变量,您可能会意外获取到特定环境中不期望的变量。在这种情况下,请确保您拥有正确的变量。
在过渡过程中,您的数据会完全保留,因此您可以切换回 EE 并恢复原有行为。
降级到 CE
执行必要的步骤后,您可以将 GitLab 实例降级到 CE。
请遵循正确的 更新指南 来确保所有依赖项都是最新的。
按照您的发行版的 安装说明 安装社区版包。
-
将您 GitLab 安装的当前 Git 远程替换为 CE Git 远程。
-
获取最新更改并检出最新的稳定分支。例如:
git remote set-url origin git@gitlab.com:gitlab-org/gitlab-foss.git git fetch --all git checkout 17-8-stable