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 mongorestore on the remaining .bson files


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 MongoDB version is 2.4 & you are going to import that mongodump backup in MongoDB , which version is 3.6. As I would like to say here as per MongoDB BOL ...

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