简体   繁体   中英

mongodump does not create backup files

I need to create a database backup of mongo database (all collections). I went to Command Line Tool page at https://cloud.mongodb.com and copied the command:

在此处输入图像描述

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!

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM