mongodbubuntumongodumpmongorestore

mongodump - What am I doing wrong?


I'm running mongo 2.6.5 & Ubuntu 14.04

I run the command;

mongodump -d MyDBname -o /home/mongobackup

and I get the following error;

2017-02-12T03:19:44.956+1000 SyntaxError: Unexpected identifier

I'm new to mongo, and all I want to do is take a dump of the 3 DB's and use the mongorestore to bring them back up on another server (exact same server expect an image from 3 months ago).

If you could please confirm that would work as well - that'd be great!


Solution

  • Modify your command as follows and try to run.

        mongodump --db MyDBname -o /home/mongobackup
    

    Please ensure your Mongo instance is running with a database MyDBname and the output directory /home/mongobackup exists.