in reply to Searching for Module to Mirror Database Table

1) Dump query result to SQL file in location A. Using the DBs dump tool is prefered.
2) Add SQL header (Create table ...) and footer (end transaction; create indexes)
2) Rsync with old file in location B.
3) Use DB B (un)dump tool into a temporary table.
4) Do a transaction on DB B: zap old table, rename temporary table.

This way minimizes network traffic and rsync does the INSERT/DELETE/UPDATE queries job. It becomes inefficient in step 3 if the file size is too large (several dozens of megabytes).

How many records are involved and which databases?

  • Comment on Re: Searching for Module to Mirror Database Table

Replies are listed 'Best First'.
Re^2: Searching for Module to Mirror Database Table
by SmugX (Beadle) on Jan 20, 2006 at 10:24 UTC

    Thanks for your reply.

    Ah yes, I can see where you're coming from, and this methodology sounds good if you're running the same database in both locations - which would, of course, be sensible, but unfortunately isn't the case for me. (Source: FoxPro 2.6a, Destination: MySQL 3.23). Sorry, I should have made that clear. (I always seem to omit some vital piece of information out of my questions, in an attempt to remove the unnecessary!).