Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mongodump - The filename, directory name, or volume label syntax is incorrect

When trying to do a mongodump we get this error:

$mongodump --host <host> -db <db> -out C:/ --username username --password password

The output is:

Failed: error dumping metadata: error creating m
etadata file C:\590690e1231230279214b1319f2\_Join:users:_Role.metadata.json
: open C:\590690e1231230279214b1319f2\_Join:users:_Role.metadata.json: The
filename, directory name, or volume label syntax is incorrect.

Is there a work-around for this when using a Windows OS machine? This db is a database of a parse-server

like image 532
quarks Avatar asked Dec 31 '25 15:12

quarks


1 Answers

Since mongoDB 3.2, the --archive option is introduced, which allows writing dump into a single file instead of a directory, e.g.:

$mongodump --host <host> --db <db> --archive <archive_file_name> --username <username> --password <password>

Note that the same option is used to specify the dump file to restore when using mongorestore.

like image 125
Lacek Avatar answered Jan 04 '26 20:01

Lacek



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!