Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MySQL help



 Matt Shields wrote: 
> Does anyone know of a way to compare 2 databases and copy over the 
> missing data. 

Take a look at Maatkit: 

http://maatkit.sourceforge.net/

which has a tool for syncing tables. 


> This is a bit more complicated because if there is a 
> customer #10 on both servers, when it's copied over, the missing 
> customer would be given a new customer number.  As a result all other 
> tables that reference that data need to be updated with that new 
> customer ID.  There are numerous tables that reference each other. 

I doubt it will handle this. You'll probably have to write something 
custom that uses the ID in conjunction with one or more infrequently 
changed fields to weed out the new records. 

It could be done in two phases. First you determine how many new records 
were created since the database split (using logs perhaps), reserve that 
number of IDs on the new DB, renumber the records on the old db to fit 
into the reserved space, then sync the tables using the above tool. 

  -Tom 

-- 
Tom Metro 
Venture Logic, Newton, MA, USA 
"Enterprise solutions through open source." 
Professional Profile: http://tmetro.venturelogic.com/

-- 
This message has been scanned for viruses and 
dangerous content by MailScanner, and is 
believed to be clean. 

_______________________________________________ 
Discuss mailing list 
[hidden email] 
http://lists.blu.org/mailman/listinfo/discuss
 


BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org