[Cialug] Merging MySQL databases

Nathan C. Smith nathan.smith at ipmvs.com
Wed Jan 21 14:44:23 CST 2009


Of course, import the old tables complete, and then insert them.  Perfect.  Thanks for being there to point out the obvious, I'll go crawl back in my hole.

-Nate 

> -----Original Message-----
> From: cialug-bounces at cialug.org 
> [mailto:cialug-bounces at cialug.org] On Behalf Of Dave Weis
> Sent: Wednesday, January 21, 2009 2:31 PM
> To: Central Iowa Linux Users Group
> Subject: Re: [Cialug] Merging MySQL databases
> 
> 
> As long as they are mostly similar you should be able to 
> select out the 
> data into an sql-like format and do some munging with a text 
> editor to 
> make it work. An example might be
> 
> SELECT 'INSERT INTO newtable VALUES ' || field1, field2, 'Y', 
> field3 || 
> '\;' FROM oldtable;
> 
> You could also just do the SELECT and in emacs or another 
> editor capable 
> of regexp replacements do something like
> 
> query-replace-regexp
> ^
> INSERT whatever
> 
> query-replace-regexp
> $
> ; control-q control-m
> 
> to put the insert stuff at the front and the semicolon on the end.
> 
> dave
> 
> On Wed, 21 Jan 2009, Nathan C. Smith wrote:
> 
> >
> >
> > I have two databases from a program I use and two different 
> versions.
> >
> > I want to merge the data from the old database into the new 
> database.  The Fields are almost the same but I'm not sure 
> what tools I should use to do this.
> >
> > Are there better ways/tools than phpMyAdmin to dump the old 
> data out of the old database, map the correct fields in the 
> new database and import the data?
> >
> > Thanks for any pointers
> >
> > -Nate_______________________________________________
> > Cialug mailing list
> > Cialug at cialug.org
> > http://cialug.org/mailman/listinfo/cialug
> >
> 
> -- 
> Dave Weis
> djweis at internetsolver.com
> http://www.internetsolver.com/
> 
> _______________________________________________
> Cialug mailing list
> Cialug at cialug.org
> http://cialug.org/mailman/listinfo/cialug
> 


More information about the Cialug mailing list