How can I import the data from a copied MongoDB folder into MongoDB on my current machine?

I had data stored in MongoDB on my previous machine, and I copied the MongoDB folder to my current machine. Now, I want to insert the data from the copied folder into MongoDB.

What is the process for accomplishing this task?

Did you want to import this into an existing MongoDB or just start a MongoDB with these copied files?

If you were intending to start a MongoDB with these files you can use the storage.dbPath as @Kobe_w linked to.

I would move the files to the default MongoDb path for the installation (RedHat: /var/lib/mongo, Ubuntu: /var/lib/mongodb) and chown -R to the appropriate user (RedHat: mongod, Ubuntu: mongodb).

If you want to import the databases in these files to an existing MongoDB you would need to start a separate instance on a different port, specifying the storage.dbPath and use the MongoDB Database Tools to export/import or dump/restore to the existing instance.