5 votes

Failed to import a mongodb database with duplicate fields

I have successfully upgraded a database from 2.4 to 4.0 using the following 3 step method: use 2.4 mongobackup on the 2.4 database delete all .json files from the outputted dump directory use 4.0 ...
user avatar
  • 151
4 votes

Failed to restored indexes using mongorestore - MongoDB

For the people who will come here in the future the issue was, I was using MongoDB 4.0 on the local and server was on 4.2: Starting in version 4.2, mongodump uses Extended JSON v2.0 (Canonical) ...
user avatar
3 votes

Mongodb _id Value and Indexes Are Lost During Mongorestore

Can anyone share their restore experiences that restored both indexes and mongodb_id? As per MongoDB documentation here By default, mongorestore looks for a database backup in the dump/ directory. New ...
user avatar
2 votes

Failed to import a mongodb database with duplicate fields

As you said you are trying to import a MongoDB database, And you are using the MongoDB command such as mongorestore. And also as you said you have taken mongodump backup of MongoDB database , which ...
user avatar
2 votes

MongoDB import bson files from a folder

mongorestore -d demo -c dcoll C:\data\dump\twitter\tweets.bson As i have gone through your MongoDB syntax query it seems to be correct. As per your script code demo is database and dcoll is ...
user avatar
2 votes
Accepted

How do I restore a database using MongoDB 5.0 CLI?

Excerpt from - https://docs.mongodb.com/database-tools/ Starting with MongoDB 4.4, the MongoDB Database Tools are now released separately from the MongoDB Server and use their own versioning, with an ...
user avatar
  • 94
2 votes
Accepted

Rename all databases when doing a mongorestore?

Should be this one: mongorestore --nsInclude="PetHotel.*" --nsFrom='PetHotel.*' --nsTo='PetHouse.*' dump/ mongorestore --nsInclude='*.*' --nsFrom='$database$.*' --nsTo='$database$2.*' dump/ ...
user avatar
1 vote
Accepted

mongodump and restore in single command

You mean like this: mongodump --archive --db=test --port=27017 | mongorestore --archive --port=27018
user avatar
  • 5,198
1 vote

Failed to import a mongodb database with duplicate fields

Problem is in metadata.json files. You need to remove 'options' and it will work just fine. I even created small python tool to do this: from glob import glob import json for filename in sorted(glob('...
user avatar
  • 111
1 vote
Accepted

mongorestore from multiple dumps

Find below the wordings from MongoDB official documentation (Insert Only) : mongorestore can create a new database or add data to an existing database. However, mongorestore performs inserts only and ...
user avatar
  • 774
1 vote

MongoDB - Mongorestore is not working as expected

Based on the oplog file you uploaded, the minimum timestamp is 1552888560 and maximum timestamp is 1553063754. But the --oplogLimit=1552828432 you mentioned in your question is not within the limit, ...
user avatar
  • 774
1 vote

MongoDB - Mongorestore is not working as expected

As per MongoDB jira blog here mongorestore --oplog will not apply oplog entries captured during the mongodump operation, and exit with an error when attempting to use mongorestore with the restore ...
user avatar
1 vote

Amount of Data transferred out in mongorestore

MongoDB 3.4 and newer servers can negotiate network compression if MongoDB clients/drivers have also been updated to support the compressed message format. Network compression was introduced as an ...
user avatar
  • 9,805
1 vote
Accepted

Assertion failure _state.get() error in MongoDB during mongorestore

With a 32-bit O/S the total addressable file size for MongoDB's MMAP storage engine is limited to ~2GB of data including indexes (and journal, if enabled). Given the 32-bit limitations for memory-...
user avatar
  • 9,805

Only top scored, non community-wiki answers of a minimum length are eligible