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.?
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:
Restore each shard seperately from a seperate dump per shard and than restore the config database.
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.