I want to daily backups for a single mongodb database, probably with mongodump. To not lose any data, I would like this to be incremental so if something goes wrong in the middle of the day, I need to be able to replay changes for that day up til the point of failure after doing a mongorestore.
Am I understanding correctly that I need to use an oplog for this? Or is journaling the answer? I tried doing the following:
- Turning my mongo database into a replica set of just one, so that it creates an oplog. (This feels pretty hacky)
- Restarting mongod with the --oplog option
- Performing changes that should be recorded in the oplog
However nothing ever gets stored in the oplog. What is the best way to do such incremental backups? I'm basically looking for a similar approach to replaying the mysql binlog.
Thanks