Mongo Dump installation

I need help with the mongo dump installation, I didn’t understand the mongo documentation.

mongodump comes with MongoDB database tools
You need to download and install tools

Thank you @Ramachandra_Tummala , I did that but installing the tools has been the issue, I don’t think I am installing it properly

What error are you getting?
What is your os?
Did you check os specific document

2 Likes

Hi @Joseph_Olusegun,
If you’re using a linux system,
The problem could be that after unzipping the database tool, you did not copy the binaries to the /usr/local/bin directory.

Regards

When i ran mongodump on my command line, i got the error - ‘mongodump’ is not recognized as an internal or external command, operable program or batch file.

My OS - Windows

Yes, I did

Thank you @Fabio_Ramohitaj
I’m using a Windows system though

It could be path issue.Did you add mongotools to your PATH?Can you run the mongodump command from bin dir?

Yes I did
This is the PATH I inputed for the Environment variables- C:\Program Files\MongoDB\Tools

I tried with this PATH - “C:\Program Files\MongoDB\Tools\100\bin”

The error I got is “The system cannot find the path specified”

Does PATH command from your windows command prompt shows new variable you added
Make sure no space at bigin or end of variable while updating the path
Also did mongodump work from bin directory?

Mongodump didn’t work from bin,
I don’t understand what you mean by this “Does PATH command from your windows command prompt shows new variable you added”
Thanks for your help so far @Ramachandra_Tummala

I tried with the bin directory again @Ramachandra_Tummala
I got this error now “2022-01-19T15:57:03.692+0100 Failed: can’t create session: could not connect to server: server selection error: server selection timeout, current topology: { Type: Single, Servers: [{ Addr: localhost:27017, Type: Unknown, Last error: connection() error occured during connection handshake: dial tcp [::1]:27017: connectex: No connection could be made because the target machine actively refused it. }, ] }”

Please show output of below

C:\Users>path

The fact that mongodump command is working(need not be a successful dump) from bin dir indicates it is issue with your path
What command you issued for mongodump?
Where is your DB? Local or on cloud?

Oh ok,
I issued ‘mongodump’ as the command
On cloud, created an app on evennode, so I’m trying to backup the database

PATH=C:\Program Files\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio;C:\Program Files\Git\cmd;C:\Program Files (x86)\Yarn\bin;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files\nodejs;C:\Users\Joseph Olusegun\AppData\Local\Microsoft\WindowsApps;C:\Program Files\heroku\bin;C:\Users\Joseph Olusegun\AppData\Local\Yarn\bin;C:\Users\Joseph Olusegun\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Joseph Olusegun\AppData\Roaming\npm;C:\Program Files\MongoDB\Server\5.0\bin;C:\Program Files\MongoDB\Tools;

Why there is a difference between above path and the path you have shown in your earlier post-“I tried with this PATH - “C:\Program Files\MongoDB\Tools\100\bin””
Which is the correct location
Please add till bin and check again

Coming to your mongodump failure from bin dir when you issue the command without uri or port,host etc it will try to connect to your default mongod running on port 27017 on your local host.Since you don’t have any mongod running it failed to connect
Please pass all appropriate params to your command.It should work