Mongorestore error "don't know what to do with file... .bjson and .json"

I am trying to use the command line cmd mongorestore to restore a backup of a mongoDB database I have. Will this restore not work with the Atlas Cluster? The original DB was just a normal localized server database.

The error I am getting is:
don’t know what to do with file “/dev/channels.bson”, skipping…
don’t know what to do with file “/dev/channels.metadata.json”, skipping…

Any help would help! Thanks

It would help us help you if you provide the following information:

Version of the Atlas cluster you are restoring to
Version of mongorestore you are using
Was mongodump the same version?
Exact command you are running when you get this error.

Usually this happens when you point mongodump at a subdirectory inside the full dump without specifying which namespace you want it to restore to, but I’m just guessing - if you provide full details, it may be more clear what the issue is.


1 Like

Use -db flag in your mongorestore command


Thanks, it worked for me as well. But we need to pass command with -d insteed of -db.

-d databaseName, now data will be restored in databaseName database.