It looks like I found answer to my question in this article: ZFS For MongoDB Backups All I need is
- to get latest oplog entry in delayed replicaset member dump (coping commands from the article, I’ll try to do that later):
revin@mongodb:~$ mongo --port 28021 local --quiet
–eval ‘db.oplog.rs.find({},{ts: 1}).sort({ts: -1}).limit(1)’
{ “ts” : Timestamp(1555356271, 1) }
- dump oplog from not delayed replicat set member (this is what I needed!!!):
revin@mongodb:~/mongodump28020$ mongodump --port 28020 -d local -c oplog.rs
–query ‘{ts: {$gt: Timestamp(1555356271, 1)}}’
- and then using mongorestore to apply date up to needed point in time:
revin@mongodb:~/mongodump28020$ mongorestore --port 28021 --dir=dump/ --oplogReplay --oplogLimit 1555356302 -vvv
I need to test this!