Table of Contents

MantisBT Schema Comparison and Update

This pages describes a process to compare a given MantisBT schema with a standard installation, and update it if necessary.

The SQL was written for a MySQL installation, and would not work on other RDBMS without adjustments due to use of metadata.

The script and process was tested using a dump from mantisbt.org bugs database taken on 13-Sep-2013.

Preparation

Process execution

At this point, the two schemas should be identical. Double-check, test and restore from backup in case of issues.

Notes

Comparing Indexes

SELECT table_schema, TABLE_NAME, index_name, non_unique, seq_in_index, column_name, sub_part, packed, NULLABLE
FROM information_schema.statistics
ORDER BY 1,2,3,5

Updating mantisbt.org bugtracker

Excluding plugin-specific tables, the following differences were found

Additionally, when attempting to create a missing unique index on username column, 2 cases of duplicate keys in mantis_user_table were discovered, (users updater, 2 records, and dmok, 3 records). After carefully checking that these accounts were not referenced anywhere in the database, the extra records were deleted through Manage Users page (keeping only the one that was created first).

As of this writing, the official tracker has not yet been updated; a message was sent to the mantisbt-dev mailing list to get feedback on the process first.