5
votes

I intalled mongodb by the following steps

  • Downloaded mongodb-macos-x86_64-4.4.0.tgz
  • sudo mv mongodb-macos-x86_64-4.4.0.tgz /usr/local/mongodb
  • mkdir -p /data/db
  • sudo chown myusername /data/db
  • mongod

Now the mongodb server is started and running, I need to import my db with the backup I have. I tried importing data with the following command

  • mongorestore --host localhost --port 27017 --db dbName /Users/userName/Downloads/mongo

It throws

  • mongorestore: command not found

How can I install mongostore and mongodumb seperately? Any help would be appreciated. Thanks in advance.

1

1 Answers

23
votes

As of MongoDB 4.4 (released July 30, 2020), you need to install mongodump separately because the MongoDB Database Tools (which comprises mongodump, mongorestore, and more) has become its own project.

I found this out because I upgraded to MongoDB 4.4 today and mongodump stopped working.

$ mongodump
zsh: command not found: mongodump

I'm on macOS and installed MongoDB via Homebrew. To get mongodump and friends back, I installed the MongoDB Database Tools via Homebrew:

brew install mongodb-database-tools

It looks like you're not using Homebrew, so this should help:

MongoDB Database Tools Installation