Support of the sharded collection
Description
Environment
Activity
radoslaw.szulgo January 9, 2025 at 4:41 PM
From @Boris Ilijic :
https://www.mongodb.com/docs/manual/administration/backup-sharded-clusters/
I'd like to comment, that's not comparable to PBM anyhow, simply because that procedure requires db to be offline for the duration of the backup (e.g. few hours):
To back up a sharded cluster with mongodump, you must stop the balancer, stop writes, and stop any schema transformation operations on the cluster.
Even if we take a cold backup, mongorestore has following significant limitation:
mongorestore does not shard restored collections on the destination cluster.
So sharding collection must be done manually for each sharded collection separately.
To conclude, mongotools backup/restore in sharded cluster is supported for the edge case (the user can tolerate to put db offline and do significant manual work during restore), but for most use cases, it is not supported.
Details
Details
Assignee
Reporter
Needs QA
Priority
Smart Checklist
Open Smart Checklist
Smart Checklist

In the sharded cluster environment following need to be accomplished in order to support ‘Selective restore with the name remapping’ (aka. cloning) feature:
add logic for cloning of sharded and unsharded collections:
cloning namesapce data itself
is it feasible: how to synchronize collection uuid between the shards? Is it possible to do that with mongorestore?
cloning metadata from config db
possible limitation: allow cloning within the same database
handling sharding key/index cloning
cloning indexes
applying PITR
there will be limitations: drop/create collection will not be possible