I have a MongoDB replica set. One of the members is a delayed replica set member that is delayed by 24 hours (slaveDelay=86400`). I have everything required to restore the database to its state at any point within the past 24 hours. But how to achieve this?
mongorestore
has a usefull option --oplogLimit=<timestamp>
. However, I’m unable to find way to get a dump that will contain delayed DB and oplog with entries up to the current time.
mongodump
has the option --oplog
that allows dump to contain oplog entries that occur during the mongodump operation. So if I dump from a delayed replica set member I get oplog with entries with changes that were applied to delayed DB during mongodump
run. But how can I dump delayed DB with the whole oplog that exits in the replica set? I would like to get oplog that includes entries up to the current moment. Is this possible?
The closest I found is this explanation: Modify and replay MongoDB oplog - Stack Overflow but I’m sure a simpler solution should exist!