lady:factory:bugzilla2mantis

Bugzilla 2 Mantis

My particular conversion method to convert a Bugzilla database (version 3.3) to a Mantis BT (version 1.2.0) Database. Mainly to due issues 371 and 372

As always, the more recent version will be the one in the Subversion Repository, but you can download a package of Bz2Mantis

You only need to edit config.php to suite your configuration. It's self explaining, basically are the MySQL username, password and database names for Bugzilla and Mantis.

The application writes directly the conversion to the Mantis database, so the MySQL user need at least read permission to Bugzilla database and write permission on Mantis database.

You need to run it from the browser. Yes, the interface is ugly and simple but the idea is that you only use it once ;). Is a step-based process where on each pass you will see:

  • The first header column showing the Bugzilla table readed
  • The second header column shows the callback function that does the mapping to Mantis
  • For each subsequent row, it will show on the first column the SQL sentence executed.
  • The second column will show MySQL errors (if any, so nothing = no error)
  • Finally a summary of SQL writes on database and the number of errors
  • A Next button or FINISHED if you reach the last step.

The more basic and easy customization can be done editting the file fieldmap.php. There (self explaining file too ;) you must NOT change the hash keys of the associative arrays and the array names. You SHOULD ONLY modify the values to your needs.

Basically this customization allow you to map priorities, severities and some other fields to be mapped.

The more hard part, only if you have PHP knowledge (and is not good documented) is to edit the mapping.php file.

This file is a bunch of functions where each function will receive an associative array from a Buzilla row and must return an array of SQL sentences to be executed on the Mantis Database. Usually you will find a comment at the start of the function telling from which buzilla table expects to receive rows.

You can develop a new function. If you do this try to keep the same structure and you will need to edit bugzilla2mantis.php to map the tables to your function1)


1)
see the code for examples using $DB→mapTable() function
  • lady/factory/bugzilla2mantis.txt
  • Last modified: 2023/06/26 22:48
  • by 65.108.103.97