Q. mongorestore error in sharded cluster

I am trying to restore data to sharded cluster using mongorestore.
However, the following error came out.

Failed: cannot do a full restore on a sharded system - remove the ‘config’ directory from the dump directory first

I didn’t know why, so I used the --nsExclude “config.*” option to restore it.

What’s the reason for the error? (Please be more specific.)
When I perform a restoration in a shaded cluster, should I exclude config db that stores metadata, etc.?

Hi @Kim_Hakseon ,

Please note mongodump and restore cannot be a production safe backups snd restores

There are 2 ways to restore a sharded cluster with mongodump if this is the only available backups:

  1. Restore each shard seperately from a seperate dump per shard and than restore the config database.

  2. If we restore fully from a mongos we need to pre shard and pre split the collections and than restore the dump without the config ao the system will rebuild the metadata from scratch.

We cannot mix.

Thanks
Pavel

I have now conducted the test in the way No. 1.
I also checked the operation normally for Sharding after no problem.

Thanks to my quick answer, I was able to test quickly and solve my curiosity.
Thank you. :smiley:

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.