首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >mongorestore :不知道如何处理文件“/home/path/ to /文件夹/regtion1.bson”,跳过

mongorestore :不知道如何处理文件“/home/path/ to /文件夹/regtion1.bson”,跳过
EN

Server Fault用户
提问于 2018-04-10 13:53:42
回答 1查看 4.4K关注 0票数 3

-我正在尝试导入mongodb数据库--从mongodb基础版本2.4.10中,我使用命令导出数据库: mongodump -d DBNAME -o / path / -I试图将转储导入到mongodb引擎版本3.6.3 -I获得了此错误:

代码语言:javascript
复制
root@server:~# mongorestore -vvvv  --nsInclude NEWDBNAME    /home/path/to/folder/
2018-04-06T10:16:35.729+0200    checking options
2018-04-06T10:16:35.734+0200            dumping with object check disabled
2018-04-06T10:16:35.734+0200    will listen for SIGTERM, SIGINT, and SIGKILL
2018-04-06T10:16:35.927+0200    connected to node type: standalone
2018-04-06T10:16:35.929+0200    standalone server: setting write concern w to 1
2018-04-06T10:16:35.929+0200    using write concern: w='1', j=false, fsync=false, wtimeout=0
2018-04-06T10:16:35.929+0200    mongorestore target is a directory, not a file
2018-04-06T10:16:35.929+0200    preparing collections to restore from
2018-04-06T10:16:35.929+0200    using /home/path/to/folder/ as dump root directory
2018-04-06T10:16:35.952+0200    don't know what to do with file "/home/path/to/folder/collection1.bson", skipping...
2018-04-06T10:16:35.952+0200    don't know what to do with file "/home/path/to/folder/collection1.metadata.json", skipping...
2018-04-06T10:16:35.952+0200    don't know what to do with file "/home/path/to/folder/collection2.bson", skipping...
2018-04-06T10:16:35.953+0200    don't know what to do with file "/home/path/to/folder/collection2.metadata".json", skipping...
2018-04-06T10:16:35.953+0200    don't know what to do with file "/home/path/to/folder/collection3.bson", skipping...
2018-04-06T10:16:35.953+0200    don't know what to do with file "/home/path/to/folder/collection3.metadata".json", skipping...
2018-04-06T10:16:35.953+0200    don't know what to do with file "/home/path/to/folder/collectionX.bson", skipping...
2018-04-06T10:16:35.953+0200    don't know what to do with file "/home/path/to/folder/collectionX.metadata.json", skipping...
.
.
.
2018-04-06T10:16:35.958+0200    finalizing intent manager with multi-database longest task first prioritizer
2018-04-06T10:16:35.958+0200    restoring up to 4 collections in parallel
2018-04-06T10:16:35.958+0200    starting restore routine with id=3
2018-04-06T10:16:35.958+0200    ending restore routine with id=3, no more work to do
2018-04-06T10:16:35.958+0200    starting restore routine with id=0
2018-04-06T10:16:35.958+0200    ending restore routine with id=0, no more work to do
2018-04-06T10:16:35.958+0200    starting restore routine with id=1
2018-04-06T10:16:35.958+0200    ending restore routine with id=1, no more work to do
2018-04-06T10:16:35.959+0200    starting restore routine with id=2
2018-04-06T10:16:35.959+0200    ending restore routine with id=2, no more work to do
2018-04-06T10:16:35.959+0200    done

Result with other command

root@server:~# mongorestore -vvv  -d  NEWDBName  /home/tmp/path/folder/
2018-04-06T10:47:22.949+0200    checking options
2018-04-06T10:47:22.951+0200            dumping with object check disabled
2018-04-06T10:47:22.954+0200    will listen for SIGTERM, SIGINT, and SIGKILL
2018-04-06T10:47:22.963+0200    connected to node type: standalone
2018-04-06T10:47:22.963+0200    standalone server: setting write concern w to 1
2018-04-06T10:47:22.963+0200    using write concern: w='1', j=false, fsync=false, wtimeout=0
**2018-04-06T10:47:22.963+0200    the --db and --collection args should only be used when restoring from a BSON file. Other uses are deprecated and will not exist in the future; use --nsInclude instead**
2018-04-06T10:47:22.963+0200    mongorestore target is a directory, not a file
2018-04-06T10:47:22.963+0200    building a list of collections to restore from /home/tmp/path/folder dir
2018-04-06T10:47:22.963+0200    reading collections for database DBNAME in folder
2018-04-06T10:47:22.963+0200    found collection DBNAME.collectionX bson to restore to DBNAME.collectionX
2018-04-06T10:47:22.963+0200    found collection metadata from DBNAME.collectionX to restore to DBNAME.collectionX
2018-04-06T10:47:22.963+0200    found collection DBNAME.collectionY bson to restore to DBNAME.collectionY
2018-04-06T10:47:22.963+0200    found collection metadata from DBNAME.collectionY to restore to DBNAME.collectionY
2018-04-06T10:47:22.963+0200    found collection DBNAME.collectionZ bson to restore to DBNAME.collectionZ
2018-04-06T10:47:22.963+0200    found collection metadata from DBNAME.collectionZ to restore to DBNAME.collectionZ
.
.
.

2018-04-06T10:47:22.964+0200    not restoring system.indexes collection because database DBNAME has .metadata.json files
2018-04-06T10:47:22.964+0200    found collection DBNAME.system.users bson to restore to DBNAME.system.users
2018-04-06T10:47:22.964+0200    found collection metadata from DBNAME.system.users to restore to DBNAME.system.users
2018-04-06T10:47:22.964+0200    found collection DBNAME.typeincidents bson to restore to DBNAME.typeincidents
2018-04-06T10:47:22.964+0200    found collection metadata from DBNAME.typeincidents to restore to DBNAME.typeincidents
.
.
.
2018-04-06T10:47:22.964+0200    finalizing intent manager with multi-database longest task first prioritizer
2018-04-06T10:47:22.964+0200    restoring up to 4 collections in parallel
2018-04-06T10:47:22.964+0200    starting restore routine with id=3
2018-04-06T10:47:22.964+0200    starting restore routine with id=0
2018-04-06T10:47:22.964+0200    starting restore routine with id=1
2018-04-06T10:47:22.964+0200    starting restore routine with id=2
2018-04-06T10:47:22.964+0200    reading metadata for DBNAME.evenements from /home/tmp/path/folder/evenements.metadata.json
2018-04-06T10:47:22.964+0200    creating collection DBNAME.evenements using options from metadata
2018-04-06T10:47:22.964+0200    using collection options: bson.D{bson.DocElem{Name:"create", Value:"evenements"}, bson.DocElem{Name:"idIndex", Value:mongorestore.IndexDocument{Options:bson.M{"name":"_id_", "ns":"DBNAME.evenements"}, Key:bson.D{bson.DocElem{Name:"_id", Value:1}}, PartialFilterExpression:bson.D(nil)}}}
2018-04-06T10:47:22.965+0200    Failed: DBNAME.evenements: error creating collection DBNAME.evenements: error running create command: BSON field 'OperationSessionInfo.create' is a duplicate field

谢谢你的帮助

EN

回答 1

Server Fault用户

发布于 2019-10-08 21:18:28

我刚刚遇到了同样的问题,很明显,您必须同时传递--db--authenticationDatabase参数。

auth数据库应该是admin,但我猜他们使用的是目标数据库,这是非常误导的。

准备迎接更多这样的惊喜--蒙戈(和他们的医生)真的糟透了。

票数 2
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/906952

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档