Home > Net >  mongodump does not create backup files
mongodump does not create backup files

Time:12-27

I need to create a database backup of mongo database (all collections). I went to Command Line Tool page at enter image description here

So I run this command in the terminal:

mongodump --uri mongodb srv://LineOf****@lineof****.fmyzn.mongodb.net/LineOf**** --out=testmongo

I enter password, it is accepted, then I do not get any files or errors. Terminal is just ready for the next command.

What do I do wrong? Thank you!

CodePudding user response:

Is your database name correct? It should show some output if it was actually dumping anything.

If the name was wrong it might not return anything.

2022-12-26T15:58:37.043-0700    writing testo.test to backup/testo/testo.bson
2022-12-26T15:58:38.469-0700    [........................]  testo.test  0/1  (0.0%)
2022-12-26T15:58:41.055-0700    [########################]  testo.test  1/1  (100.0%)
2022-12-26T15:58:41.055-0700    done dumping testo.test (1 document)

For example, for a database named testo the command should look like:

mongodump --uri mongodb srv://user@*****.mongodb.net/testo --out=backup

Then, in that case you'd have a folder called backup with a testo folder inside it with the backup.

  • Related