Most MongoDB backup guides stop at the mongodump command line. That is the
easy part. What decides whether you get your data back is everything around it:
what the dump leaves out, which options change what you will be able to restore,
whether the script really fails when the dump fails, and whether anyone has ever
replayed the file.
This guide covers the whole chain. By the end you will know what a mongodump
holds and what it leaves to the server, when --oplog is worth anything, how to
write a backup script that cannot report success on an empty file, how to
restore the archive by hand in a throwaway container, and which questions asked
in mongosh tell you a restored database actually holds your data.
Everything here works with mongodump , docker and the AWS CLI, and nothing else.
What a mongodump backs up, and what it leaves out
mongodump reads documents over the server protocol, like any other client. So
it backs up data , not a server:
users and roles are not part of it.…