0

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!

ares
  • 4,283
  • 6
  • 32
  • 63

2 Answers2

0

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.

RLD
  • 1,867
  • 3
  • 15
  • 20
0

You are probably executing this command inside mongo cli. Try this directly on shell.

Do not forget to pass your user and password together.

abdemirza
  • 629
  • 4
  • 16