Merging the Mantis Bug Tracker's Data

I need to merge two mantis data. They are from different versions of the application, and located differently.

Hopefully, some of you have experienced this kind of case as well.

Would you please guide me how can I do this?

So what is your actual question to do with MySQL?

To merge two databases together, that is used by two different versions of mantis.
I have two individual copies of running bug trackers.
Now, I would like to make them a single unit.

It can be a very tedious process.
But if anyone of you have done this earlier, I would like to know it.

Hello Bimal,

I have a similar question, that I just posted at: http://www.mantisbt.org/forums/
Hopefully I will get some helpful response. This is the way I put my question:


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