服务器无法通过系统版本,mongorestore问题:无法将架构版本1的用户还原到服务器版本为2.5.4或更高的系统(mongorestore issue : Cannot restore users...

在尝试使用mongorestore将MongoDB从2.4.8升级到2.6.3时遇到问题,因为用户模式的架构版本不兼容。解决方案包括两种方法:一是先恢复到2.4再升级到2.6,二是使用2.4版本的mongorestore恢复到2.6后升级用户模式。在升级前建议使用2.6的mongoshell进行兼容性检查。
摘要由CSDN通过智能技术生成

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.

我们希望这样做的方式是首先使用mongorestore将数据加载到运行2.6.3的另一台服务器。 但是,当运行mongorestore命令时,我们得到以下错误:

Cannot restore users with schema version 1 to a system with server version 2.5.4 or greater

我找不到与此问题相关的任何内容,也不知道该怎么办。 如果它很重要,数据库本身并不是从mongo 2.4.x开始创建的,而是使用以前的版本。

我做什么? 除了使用mongorestore之外,还有另外一种方法吗?

预先感谢您的帮助 ...

I have a mongodb production database running on mongo 2.4.8 and I would like to upgrade to 2.6.x.

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 mongorestorecommand we get the following error:

Cannot restore users with schema version 1 to a system with server version 2.5.4 or greater

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.

What ca I do ? Is there another way of doing this other than using mongorestore ?

Thank you in advance for your help ...

原文:https://stackoverflow.com/questions/25181769

更新时间:2020-01-13 09:59

最满意答案

有两种方法可以用2.4 mongodump升级用户模式。

1)恢复到MongoDB 2.4,然后升级到2.6

这遵循正常的2.6升级路径 。 不要试图将你的2.4备份直接存储到2.6中,而应该恢复到2.4实例,然后升级到2.6。

建议在升级之前,通过2.6 mongo shell运行db.upgradeCheckAllDBs() 。 这会检查由于MongoDB 2.6中的更改而导致的任何潜在兼容性问题 。 例如,2.6实施更强大的索引字段定义和密钥长度限制。

2)使用2.4 mongorestore恢复到MongoDB 2.6,然后升级用户模式

这种方法需要MongoDB 2.4版本的mongorestore

在未启用身份验证的情况下启动MongoDB 2.6 mongod

使用2.4版mongorestore备份您的备份

db.adminCommand({authSchemaUpgrade: 1 });

使用auth启动您的2.6 mongod

There are two approaches you can take to upgrade your user schema with the 2.4 mongodump.

1) Restore into MongoDB 2.4 and then upgrade to 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.

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.

2) Restore into MongoDB 2.6 using 2.4 mongorestore and then upgrade the user schema

This approach requires the MongoDB 2.4 version of mongorestore

start up your MongoDB 2.6 mongod without auth enabled

mongorestore your backup using a 2.4 version of mongorestore

run the authSchemaUpgrade command in your 2.6 mongo shell: db.adminCommand({authSchemaUpgrade: 1 });

restart your 2.6 mongod with auth enabled

相关问答

不,不可能降级数据库。 10.50.1600是SQL Server 2008 R2版本。 绝对没有办法将此数据库还原或附加到要尝试恢复的SQL Server 2008实例(10.00.1600是SQL Server 2008)。 您唯一的选择是: 将此实例升级到SQL Server 2008 R2 或 恢复您在SQL Server 2008 R2实例上的备份,导出所有数据并将其导入SQL Server 2008数据库。 No, is not possible to downgrade a data

...

除非您正在还原特定文件组,否则还原将包括数据和架构。 完成数据库恢复将包括所有模式和数据库,并且将完全替换数据库。 如果您要创建文件组并将特定表放入文件组中,那么您可以只恢复那些您想要的文件组,并且这些文件组仅包括表格的数据和模式(以及放入文件组的其他任何内容 - 如索引,物化视图等) 您应该真正看到的是架构和数据比较工具。 像Redgate,ApexSql Compare,AdeptSQL或Visual Studio Database Edition这样的东西都可以很好地完成您描述的场景。 我个

...

为邮件添加了一个插件 libraryDependencies ++= Seq(

"com.typesafe.play" %% "play-mailer" % "5.0.0-M1"

)

任何我的java代码 import org.apache.commons.mail.DefaultAuthenticator;

import org.apache.commons.mail.EmailException;

import org.apache.commons.mail.HtmlEmail;

...

您的配置似乎缺少一些东西。 以下是我使用的工作配置示例(仅替换实名)。 注意,没有使用hibernate.cfg.xml。 build.sbt: val hibernateVersion = "4.3.10.Final"

val mySqlConnectorVersion = "5.1.36"

libraryDependencies ++= Seq(

javaJpa

)

...

libraryDependencies ++= Seq(

...

"org.hibernate"

...

有两种方法可以用2.4 mongodump升级用户模式。 1)恢复到MongoDB 2.4,然后升级到2.6 这遵循正常的2.6升级路径 。 不要试图将你的2.4备份直接存储到2.6中,而应该恢复到2.4实例,然后升级到2.6。 建议在升级之前,通过2.6 mongo shell运行db.upgradeCheckAllDBs() 。 这会检查由于MongoDB 2.6中的更改而导致的任何潜在兼容性问题 。 例如,2.6实施更强大的索引字段定义和密钥长度限制。 2)使用2.4 mongorestor

...

解: 1)通过注册您的电子邮件ID http://support.microsoft.com/kb/2597150从此链接下载此修补程序 2)解压缩文件并运行exe注意:在安装期间不要运行SharePoint 2010配置向导... 3)安装成功后重新启动系统。 4)运行SharePoint 2010配置向导设置。 5)再次启动恢复操作,问题得到解决 有时候你会得到渲染错误 要解决此问题,请转至集中管理,然后打开服务器配置并启动状态服务 Solution: 1) Download the hot

...

你不能撤消get; 修改后的版本已被覆盖。 但是,您可以将所有文件添加回项目中。 最简单的方法通常是启用“显示所有文件”,然后对于每个丢失的文件,您可以执行“包含在项目中”。 You can't undo the get; the version with your modifications has been overwritten. You can, however, add all the files back into the project. The easiest way is usu

...

您的备份来自SQL Server 2008 R2 (版本10.5) 您正在尝试还原到SQL Server 2008(版本10.0) 它无法完成 你需要: 将目标服务器升级到SQL Server 2008 R2 使用SSIS迁移架构和数据 使用SSMS向导来迁移架构和数据 Your backup is from SQL Server 2008 R2 (version 10.5) You are trying to restore onto SQL Server 2008 (version 10.0)

...

好吧,我烧毁了一个与微软有关此问题的支持事件。 经过大约12个小时的故障排除后,问题仍然没有得到解决。 当我开始怀疑这是否甚至是Windows的问题时,我发现了另一篇帖子,其中有一个人遇到了完全相同的问题: ASP.NET状态服务版本的问题; 国家服务是1.1,网站是3.5 所以,这看起来可能是最新版Virtuozzo的一个错误。 我最终创建了一个Windows服务,在服务器启动期间运行以下3个命令。 虽然我尝试使用.bat文件并使用Windows计划任务来触发命令,但我似乎无法使其正常工作。 创

...

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值