5

I am getting error while importing DB backup using mongorestore command with dump.gz

Using following command to restore DB:

mongorestore --gzip --archive=dump.gz --nsInclude=MyApp

Getting following error:

2019-12-04T14:14:40.352+0530    Failed: EOF
2019-12-04T14:14:40.352+0530    0 document(s) restored successfully. 0 document(s) failed to restore.

What is wrong with this command?

halfer
  • 19,824
  • 17
  • 99
  • 186
Nisar Saiyed
  • 728
  • 1
  • 8
  • 17

1 Answers1

0

--nsInclude="MyApp" syntax is wrong

Try for example: Syntax:

mongorestore --nsInclude=dbName.collectionName

You can also restore a specific collection or collections from the dump/ directory. For example, the following operation restores a single collection from corresponding data files in the dump/ directory:

mongorestore --nsInclude=test.purchaseorders dump/

If the dump/ directory does not contain the corresponding data file for the specified namespace, no data will be restored. For example, the following specifies a collection namespace that does not have a corresponding data in the dump/ directory:

mongorestore --nsInclude=foo.bar dump/