Restoring Mongodb database in Windows by using dump taken from Ubuntu server

I have taken a dump from Ubuntu v20 server using mongodump. I need to use it on my Windows laptop.

In my Windows laptop,

a. from which directory should I execute the mongorestore command?

b. where should the dump folder be saved?

When I try to execute the mongorestore command from my projects directory in windows, it does not recognize the command.

I also tried to do the same from C:\Program Files\MongoDB\Server\5.0\bin, but got the same error.

ERROR: <mongorestore : The term 'mongorestore' is not recognized as the name of a cmdlet, 
function, script file, or operable program. Check the spelling of the name, or if a path was 
included, verify that the path is correct and try again.>

I prefer to do this from the directory containing the dump folder. But it can be done from anywhere as long as all the correct options are used.

Doesn’t matter.

Add the binary directory to your PATH variable or specify the full path to mongoresotore

Did you install mongodb-tools

1.Download Mongodb command line tool
2.Set tools path in windows environment variables

Then run from any where

You can follow docs set Mongorestore in env variables

1 Like

I had not downloaded the DB CLI Tools. I did that, and now its working fine.

1 Like