-Estou tentando importar um banco de dados mongodb - De um mongodb base versão 2.4.10 exportei o banco de dados com o comando: mongodump -d DBNAME -o / caminho / pasta -Eu tentei importar o despejo para um motor mongodb versão 3.6.3 -Eu tenho esse erro:
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
Obrigado pela ajuda
Tags mongodb