Reputation: 109
I have copied a db from a remote mongodb server to my local machine. Now more data are added into the remote server and I want to update the local db from it. How should I achieve this? Thanks!
Upvotes: 0
Views: 973
Reputation: 4913
Full disclosure, I work for MongoDB. Now that that is out of the way, there are essentially 2 main ways to do what you are asking:
Each one has advantages and disadvantages.
Full Copy
You have 4 options here
Incremental Copy
There are many options, here, I am going to list 2 that I am most familiar with
Both options 2 and 3 will most likely require you to do some sort of namespace filtering to ensure you only get OpLog related to the specific collection or database you are concerned with moving.
My general recommendation is to use one of the following
These leave the least room for error and are generally quite robust for a variety of needs.
Upvotes: 1
Reputation: 9473
It depends of the data you have. If there is a timestamp field you could use mongo export with query parameter and ask for new documents since last copy.
Upvotes: 0