command prompt are showing 'mongorestore' is not recognized as an internal or external command, operable program or batch file

Viewed 19898

I have installed the MongoDB community version in my window machine and set the environment path of the MongoDB bin folder. From the command prompt, mongod and mongo command is working but mongorestore and mongodump are not working. enter image description here

5 Answers

Yes as @Rohit said , we need to download separately from the given link . But that is not enough to run the mongorestore command .

Additionally we should set the path of the Mongo db tools in to our environment variable. After I have done that the command has recognized from my end .

Sample path set in to my windows machine environment varible eg,

C:\Users\ssa\Downloads\mongodb-database-tools-windows-x86_64-100.2.1\bin

You can also download the mongodb database tools and paste it's contents of the bin folder to the bin folder of mongodb server. It works for me in mongodb version 4.4:

Example:-
From:
C:\Program Files\MongoDB\Tools\100\bin
to:
C:\Program Files\MongoDB\Server\4.4\bin

In new versions of mongodb, tools are separately installed so do install mongodb tools from https://www.mongodb.com/try/download/database-tools create a separate folder tools in programfile/mongoDB/tool then extract downloaded tools there, then go to

C:\Program Files\MongoDB\tool\mongodb-database-tools-windows-x86_64-100.5.1\bin 

and create an environment variable of that path, then you will me able to use mongodump mongorestore

This is what worked for me! I'm using windows.

  1. Download zip file from https://www.mongodb.com/try/download/database-tools
  2. Move files into C:/Program Files/MongoDB/Server/5.0/bin
  3. Go to "start" on your computer
  4. Search for "edit the system environment variables"
  5. Click on "Environment Variables..."
  6. In the second list, double click on "path"
  7. Add new path "C:/Program Files/MongoDB/Server/5.0/bin"
  8. Restart your computer (this was essential for me)
  9. Go to your commmand line
  10. Type "mongorestore --version"
Related