Search code examples
node.jsmongodbmongoimportmongoexport

How to get mongodb sync or change log and apply it on another instance?


Is it possible to get a changelog of changes in mongodb , say from a given timestamp and then apply it at another instance of mongodb?

These 2 instances have same collection but changes to one is independent of the other.

Ideally the change log would be a transaction log of all the data changes that have happened from a given instance of time.


Solution

  • looks like the only way is to start the mongodb server in replica mode and get the oplog (as discussed with mongodb's solution architect - vigyan)

    mongodb --replSet rs0
    

    link to convert your standalone server to replica