Exporting a mantis bug tracker database

I’m just doing a migration of a mantis bug tracker db to a newer version (now on a jumpbox – yeah!). Old v was 0.19.3 and the new one is 1.1.2 so it’s about time…

The migration is not a real migration, I’m just re-posting all open issues in the new system and exporting the entire old system for reference.

Here are the queries that gets what I want from the old mantis db, which I then export as csv and html, nice:

## All bugs
select
mpt.name,
mbt.id,
mbt.summary,
mbt.last_updated,
mbt.status,
mbt.severity,
mbtt.description,
mbtt.additional_information,
mut.realname as Reporter
from
mantis_project_table mpt,
mantis_bug_table mbt,
mantis_bug_text_table mbtt,
mantis_user_table mut
where
mbtt.id = mbt.bug_text_id and
mbt.project_id = mpt.id and
mut.id = mbt.reporter_id
order by mbt.last_updated DESC;

# status 10=new, 50=assigned, 80=resolved, 30=ackknowledged, 90=closed

## All notes
select
mpt.name,
mbt.id,
mbt.summary,
mbntt.note,
mut.realname
from
mantis_bugnote_text_table mbntt,
mantis_bugnote_table mbnt,
mantis_bug_table mbt,
mantis_project_table mpt,
mantis_user_table mut
where
mbnt.bug_id = mbt.id
and
mbnt.bugnote_text_id = mbntt.id
and
mpt.id = mbt.project_id
and
mbnt.reporter_id = mut.id
order by mbt.last_updated DESC;

Tags: , ,

Leave a comment