mongorestore问题:无法将架构版本1的用户还原到服务器版本2.5.4或更高版本的系统 [英] mongorestore issue : Cannot restore users with schema version 1 to a system with server version 2.5.4 or greater
问题描述
我有一个在mongo 2.4.8上运行的mongodb生产数据库,我想升级到2.6.x.
I have a mongodb production database running on mongo 2.4.8 and I would like to upgrade to 2.6.x.
我们要这样做的方法是,首先使用mongorestore
将数据加载到运行2.6.3的另一台服务器上.但是,在运行mongorestore
命令时,会出现以下错误:
The way we want to do that is first load the data to another server running 2.6.3 using mongorestore
. However when running the mongorestore
command we get the following error:
Cannot restore users with schema version 1 to a system with server version 2.5.4 or greater
我找不到与此问题有关的任何东西,也不知道该怎么办.万一重要,数据库本身不是使用mongo 2.4.x从头开始创建的,而是使用以前的版本创建的.
I cannot find anything related to this issue and do't know what to do. In case it matters, the database itself was not created from scratch with mongo 2.4.x but with previous versions.
我该怎么办?除了使用mongorestore之外,还有其他方法吗?
What ca I do ? Is there another way of doing this other than using mongorestore ?
预先感谢您的帮助...
Thank you in advance for your help ...
推荐答案
可以使用两种方法来升级2.4 mongodump
的用户架构.
There are two approaches you can take to upgrade your user schema with the 2.4 mongodump
.
这遵循正常的 2.6升级路径.与其尝试将2.4备份直接直接mongorestore
到2.6,而是还原到2.4实例然后升级到2.6.
This follows the normal 2.6 upgrade path. Instead of trying to mongorestore
your 2.4 backup directly into 2.6, restore into a 2.4 instance and then upgrade to 2.6.
建议在升级之前,运行 db.通过2.6 mongo
shell升级upgradeCheckAllDBs().这会检查由于MongoDB 2.6的更改而引起的任何兼容性问题.例如,2.6实现了对索引字段定义和密钥长度限制的更强大实施.
It is recommended that before upgrading, you run db.upgradeCheckAllDBs() via a 2.6 mongo
shell. This checks for any potential compatibility issues due to changes in MongoDB 2.6. For example, 2.6 implements stronger enforcement of index field definitions and key length restrictions.
此方法需要MongoDB 2.4版本的mongorestore
This approach requires the MongoDB 2.4 version of mongorestore
-
启动MongoDB 2.6
mongod
未启用身份验证
mongorestore
使用mongorestore
运行 mongo
shell中:
run the authSchemaUpgrade
command in your 2.6 mongo
shell:
db.adminCommand({authSchemaUpgrade: 1 });
在启用身份验证的情况下重新启动2.6 mongod
这篇关于mongorestore问题:无法将架构版本1的用户还原到服务器版本2.5.4或更高版本的系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!