I want to back up daily for one mongodb database, possibly using mongodump. In order not to lose any data, I would like it to be incremental, therefore, if something goes wrong in the middle of the day, I need to be able to reproduce the changes for this day until the moment of failure after the mongorestore.
Do I understand correctly that oplog needs to be used for this? Or is the response logged? I tried to do the following:
- Turning my mongo database into a replica set of only one, so that it creates an oplog. (It seems pretty hacked)
- Restart mongod with the -oplog option
- Making changes to be written to oplog
However, nothing is saved in oplog. What is the best way to do such incremental backups? I am basically looking for a similar approach to playing the mysql binary file.
thanks
source share