Menu

1 / 3

Back up MongoDB to S3: from mongodump to a verified restore

DEV Community: mongodb·Benjamin Touchard·3 days ago
#GQ31pNXg
#devtomongodb#devto#dev#dump#database
Long article (1780 words) — no AI summary yet.
Reading 0:00
15s threshold

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.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.