1

The MongoDB documentation on --oplogReplay is a bit vague. It just keeps saying a "point in time" snapshot. How is this different from dropping the sink database and restoring from the source?

What are the pros and cons of using --oplogReplay?

1

An OpLog is like a transaction log, thus if you had a 'full' backup of the system but wanted to get incremental data after the full backup was taken you can replay the opslog to get a 'point in time' restore of the database. It let's you have more control on being able to address at exactly what point you want to restore everything. Let's say someone dropped a critical collection at 12:05:23. You could do a opslog replay up to 12:05:22 for example.

  • Since the OpLog is a capped collection there must be some limitation as to when an oplogReplay is still viable right? Sorry are you saying it does a diff between my oplog and the existing oplog to discern what was missing from my snapshot? Ah also it requires you to restore an entire replica set not just a collection or database :( – Breedly Nov 30 '18 at 18:59
  • Yes good point on the replica set if you're using that, usually the opslogs restrictions are 'from the last full backup' but using Mongo Manager you're only able to go back 24 hours. I haven't tested a opslog restore prior to 24 hours though, I can on my test cluster this weekend if it helps – Ali Razeghi Nov 30 '18 at 19:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.