Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: How to synchronize two database tables in MySQL?

by bsb (Priest)
on Jan 08, 2006 at 11:02 UTC ( [id://521804]=note: print w/replies, xml ) Need Help??


in reply to How to synchronize two database tables in MySQL?

Alzabo has schema diffing and altering capabilities. You may be able to automatically import you schemas and then generate the ALTERs required.

It's been a long time since I used Alzabo, so I'm not sure of the current status or whether this plan is feasible. Perhaps someone else can provide more up to date information.

Usually I just diff the schema dumps and migrate by hand. But as I have only one deployment it's easy.

mysqldump dev -d --add-drop-table=false > dev.sql mysqldump live -d --add-drop-table=false > live.sql perl -pi -e 's/^--.*\n//;s{/\*.*\*/;\n?}{}' dev.sql live.sql diff -B -U 5 dev.sql live.sql > schema.diff

Brad

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://521804]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2024-04-23 17:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found