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 | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


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

Re: MySQL Help



 On Jan 18, 2008 10:31 AM,  <[hidden email]> wrote: 
> Well, the first thing to do is shut down the old site and redirect it to 
> the new site so new conflicts no longer happen. 

Yup, already did that.  Old website (even though DNS is updated) 
points to new DB. 

> The second thing to do is decide if this can be done with the site down or 
> with it running. If it is down, you can take your time. I strongly suggest 
> shutting in down while the process is in progress, but you can dump old 
> and new databases and create a work/test environment. 

Needs to be live 

> On the test environment, you are going to see what the conflicts are. If 
> they are trivial, no problem, do it by hand, if not.... 
> 
> Make sure you have shut off the old site and used a redirect to the new 
> site, then your problem is merely extracting (1) unique data from the old 
> site and (2) resolving conflicting data from the new site. 
> 
> Load both databases into mysql, but rename the old tables to 
> old_table.(substituting the actual table name for "table") Find the stuff 
> that is not in "table" that is in "old_table. Probably use a left outer 
> join and a where right col is NULL. 
> 
> This will get you the stuff that is unique in the old things. You can save 
> the diff tables as stuff that can be added the the new tables without much 
> fuss. 
> 
> The next query is something like this 
> 
> create table wasis_table as select table.id as is, old_table as was where 
> [some fully unique qualifiers]. 
> 
> This will create a was/is for remapping non-unique ids. 
> 
> lastly IDs that are only in the old database should be assigned new IDs. 
> 
> Well, I could go on and on, but basically you work on an off-line snapshot 
> of the two databases, and produce a series of scripts that you can apply 
> to new databases. 
> 
> I've had to do it before on a couple systems and there is no easy way, 
> even when you have redo logs ala oracle. 


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