Downgrade 6.0 Standalone to 5.0
尝试降级之前,请先熟悉本页面的内容。
降级路径
如果需要从 6.0 降级,请降级到最新的 5.0 补丁版本。
MongoDB 仅支持单版本降级。您无法降级到比当前版本落后多个版本的版本。
例如,您可以将 6.0 系列部署降级为 5.0 系列部署。但是,不支持将 5.0 系列部署进一步降级为 4.4 系列部署。
访问控制
If your deployment has access control enabled, your downgrade user
privileges must include privileges to list and manage indexes across
databases. A user with root
role has the required
privileges.
先决条件
在开始降级程序之前,必须完成以下先决条件步骤。
1. Create Backup
可选但建议使用。创建数据库备份。
要学习;了解如何创建备份,请参阅自托管部署的备份方法。
2. Remove Backward-Incompatible Features
如需从 6.0 降级到 5.0,必须删除与 5.0 不兼容的 6.0 功能。有关不兼容功能的列表以及如何删除这些功能,请参阅“降级注意事项”。
3. Downgrade Feature Compatibility Version (FCV)
To downgrade the featureCompatibilityVersion
of your standalone
instance:
将
featureCompatibilityVersion
降级为"5.0"
。db.adminCommand( { setFeatureCompatibilityVersion: "5.0" } ) setFeatureCompatibilityVersion
命令对内部系统集合执行写入操作,并且是幂等的。如果命令未成功完成,请在mongod
实例上重试命令。
降级程序
警告
Before proceeding with the downgrade procedure, ensure that the prerequisites have been completed.
Update configuration files.
Disable any configurable 6.0 features by updating the
mongod
instance's configuration file before
restarting.
To see the list of configurable 6.0 features, review the 6.0 Release Notes.
Restart with the latest 5.0 mongod
instance.
要启动 mongod
进程,请运行以下命令:
mongod --dbpath </path-to-data-folder>
如需了解有关启动 mongod
进程的更多信息,请参阅“启动 mongod
进程”。