Merging two Mantis Bugtracker Databases

General discussion of Mantis.

Moderators: Developer, Contributor

Post Reply
braindea
Posts: 2
Joined: 06 Oct 2011, 20:02
Contact:

Merging two Mantis Bugtracker Databases

Post by braindea »

Hello all. I've been given a task at work that goes something like this...

Several months ago our company "split" the tickets for a partner into its own bugtracker database. We're on an older version that has customizations. They set up an instance of the db and copied all their tickets to that instance (leaving the original records in our db) - and for these couple of months our system has had new tickets entered, and the partner has been entering new ones, and editing their existing ones. Now the partner has moved their tickets to another system, and we have to "merge" their new tickets, and updates to existing ones back into our main instance, and decommission the one they had been using. This is my task. I'm planning to use SSIS (I'm a SQL Server dba, but pretty familiar with MySQL and php). I got the MySQL ODBC 3.51 connector installed as well as MySQL Workbench - but my main platform is Microsoft stack.

I assume that the partner's "updated" records will be pretty easy to deal with. I think I can assume that an issue with ID (e.g.) 50000 and entered before the spit - on both systems is the same bug, so overwriting the destination records with the source records (source is the partners system) should effectively "update" - and we get the 'changes' they have made these couple of months.

Since we entered new tickets on our system for our own bugs, and they entered tickets for their bugs (after the split) - we will have an 'overlap' in probably a couple hundred (maybe thousands) of tickets entered during the time we were operating independantly - but in parallel. My plan for their new tickets entered since the split - is to effectively 'append' their set of bugs after ours - generating a new bugtracker ID. It looks like the table that spawns off the new ID is mantis_bug_table (as the parent table) - capture the ID assigned; then copy over all associated records into the target (our) system - and change the ID in transit. That way all the FKs refer to the new bugtracker ID. I will have to stuff the original ID in some searchable field so that when we need to look up a partner-generated ticket - and they refer to it by the old ID, we'll be able to locate the new ID it was given in our system.

Obviously it was easier for them to split the partner's tickets into their own db instance. They probably did an equivalent to SET IDENTITY_INSERT ON - to allow the records to be inserted without a change in ticket number. Copying their updated records back into ours shouldn't present too much of a problem - but it's moving their newly entered ones without affecting our new ones; that seems a bit trickier. So my question to the forum is: Has anyone else had to do something like this?

I noticed that there is some sort of Import-related plug-in. Since our version of Mantis is probably two years back, with customizations - it would be unlikely I could use it straight out of the box. But - if I could find the source for this - it might help in educating me about the hierarchy of the table relationships - or alert me to things I haven't considered yet.

Thank you for reading through this. I'll welcome any insight or advice.

Rick
atrol
Site Admin
Posts: 8575
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Merging two Mantis Bugtracker Databases

Post by atrol »

braindea wrote:But - if I could find the source for this -
Maybe this one https://github.com/mantisbt-plugins/csv-import
And also one of the plugins which is part of a standard MantisBT installation since version 1.2.x https://github.com/mantisbt/mantisbt/tr ... portExport
Please use Search before posting and read the Manual
braindea
Posts: 2
Joined: 06 Oct 2011, 20:02
Contact:

Re: Merging two Mantis Bugtracker Databases

Post by braindea »

Thank you Atrol - I will look at this.

The version we are on appears to be 1.0.2 (vintage 2006) - but I'm not necessarily looking for an "off the shelf" solution - more of how other people may have approached this problem. FYI, I found another item (looks to be off this site too - a Bugtracker ticket on Bugtracker itself) - at:
http://www.mantisbt.org/bugs/view.php?id=7229

I'm going to take a look at the packages there too.

There's another post I found from someone on another forum:
http://www.sitepoint.com/forums/showthr ... ght=mantis
who seems to have the same task (post is 1 month old). I replied that this might be the place to go for help.

As an aside - I'll just say that although I hadn't worked with Mantis before this summer (we call it "Issue Tracker") - but have worked with numerous similar systems - This is a pretty darn good system. I know a lot of work goes into building and expanding it. Thanks to the developers who provide such value.

- Rick
cas
Posts: 1768
Joined: 11 Mar 2006, 16:08
Contact:

Re: Merging two Mantis Bugtracker Databases

Post by cas »

I wrote some scripts in the past about merging instances. It should be available on the forum or on the bugtracker.
if not, I can send it to you.
Post Reply