mongodump and mongorestorecannot be part of a backup strategy for 4.2+ sharded clusters that have sharded transactions in progress, as backups created with mongodumpdo not maintain the atomicity guarantees of transactions across shards.
Are we not allowed to use mongodump and restore on a running mongodb database in a production environment?
You definitely can use mongodump & mongorestore in production. The statement was saying that if there are sharded transaction in progress, then the backup will contain things that are in flight inside the transaction, and thus the backup do not provide a consistent view of the database.
Having said that, it’s best if you stop all writes while mongodump is in progress anyway, just to be sure that you’re not backing up an inconsistent view of database.
@Balram_Parmar in both Ops Manager and Cloud Manager, we do not use mongodump to backup the database. We developed a backup system specifically for Ops Manager and Cloud Manager that is designed to ensure consistency and correctness for both replica sets and sharded clusters, while the database is still fully operational. This ability is unique to Ops Manager and Cloud Manager due to the capabilities of the agent and other features designed specifically to ensure accurate backups for all deployment types.