Close your eyes, and picture for a moment that you are riding a roller-coaster. Now, open your eyes and have a look at your MongoDB installation! Even something as simple as backup and restore becomes highly problematic when applied to a MongoDB installation that contains replica sets and where collections are split up into shards!Â
The primary tools for performing backup and restore operations are mongodump and mongorestore.Â
You can also take snapshots of your data rather than attempt to dump the entire local database. This technique is considered a best practice; however, it is operating system-specific and requires setting up operating system tools that are outside of the purview of this book. For more information, see the Backup and Restore Using Filesystem Snapshots topic in the MongoDB documentation. For documentation on mongodump, see https://docs.mongodb.com/manual/reference/program/mongodump/#mongodump. For documentation...