From: Christian H. <chr...@ed...> - 2006-03-13 07:03:44
|
> -----Original Message----- > From: man...@li... > [mailto:man...@li...] On Behalf > Of Christian Hack > Sent: Monday, 13 March 2006 11:25 AM > To: man...@li... > Subject: RE: [Mantisbt-help] Merging 2 Mantis DBs into one > > > > -----Original Message----- > > From: man...@li... > > [mailto:man...@li...] On Behalf > > Of Volker Wegert > > Sent: Thursday, 9 March 2006 11:06 PM > > To: man...@li... > > Subject: Re: [Mantisbt-help] Merging 2 Mantis DBs into one > > > > > > Hi! > > > > "Christian Hack" <chr...@ed...> writes: > > > Is this just plain silly? Possible? Worth re-entering all > > data from the > > > second DB into the first one? Has anyone done anything > > similar before? > > > > I will have to do something similar some day, but I don't yet > > know when this > > will happen. Maybe I'll write a small (Java? not sure) > > application that > > merges our two Mantis installations. My main problem is that > > one of the > > installations has been modified rather heavily and that I'm > > not sure what > > issues will arise from this. > > > > I have attached what is my current version of my update > script. What this > does is forces the database to be imported to use SQL ids > that differ from > the primary DB. So the +xxxx numbers need to be catered for > so that 1) they > are higher than the primary database and 2) are higher than > the secondary > database also. > > There are few things I haven't allowed for such as files and > news since they > weren't really used in the secondary database. It should be > fairly obvious > what is required though. > > I also had to map users from the second database to map to > correct users in > the primary database. Obviously this may or may not apply and > if it does all > the ids would need fixing. As we are only about 40 or 50 > users, this wasn't > a big hassle. > > This keeps everything correct. The only thing that is lost is that the > bug-ids from the database to be imported. They now have an offset. > > So I run the script on the secondary database and then simply > copy all the > data from the secondary DB to the primary using MySQL-Front. Nothing > conflicts due to my .sql script. > > It's clunky, yes, but was much more effective than > re-entering the data for > 170 odd issues in the primary DB. It probably took me an hour > to knock up. > Oops, first one had a minor bug where I didn't have the bug text id field incremented correctly and the user update stuff needed to be split up. CH |