Page 1 of 1

Mantis 1.2.8 Batch Delete Categories

Posted: 25 Jan 2012, 22:35
by Coolpro21
I'd like to know if there is a way to batch delete categories from projects. I have ~33 projects with 87 of the same categories each, and I have decided to use the Global Categories instead. Currently I only see that I can manually delete one category at a time from a single project. This is time consuming to do this with a confirmation for every category that I need to delete. Once I've done this, I have to manually go back and re-categorize the bugs. Is there a quicker way to delete categories?

Re: Mantis 1.2.8 Batch Delete Categories

Posted: 25 Jan 2012, 23:29
by atrol
Coolpro21 wrote:This is time consuming to do this with a confirmation for every category that I need to delete. Once I've done this, I have to manually go back and re-categorize the bugs. Is there a quicker way to delete categories?
I think you will get problems if you delete the categories before you re-categorize the bugs.

To delete categories you can delete from mantis_category_table (using mysql or phpMyAdmin)
Global categories have project_id = 0, so if you want to use only global categories you have to delete all where project_id <> 0

I strongly recommend a database backup before you try such operations.

Re: Mantis 1.2.8 Batch Delete Categories

Posted: 27 Jan 2012, 15:52
by Coolpro21
Thanks atrol! Fortunately I have a development environment, in which I made a backup of the categories table and then deleted. But I wasn't aware of the global categories project Id = 0, so of course it crashed Mantis, but I was able to restore the back up. I figured out how to re-categorize en-mass to the Global categories for each project, so that helped. Ha! Mantis shot out hundreds of update emails which pissed off a couple of directors and the CIO, but they got over it once I explained the benefit of Global categories over individual categories per project. I will test out deleting those tables from phpMyAdmin in my dev environment, making sure to exclude project_id 0, after making a back-up.

As always atrol, I appreciate your expertise and willingness to help out.

Re: Mantis 1.2.8 Batch Delete Categories

Posted: 27 Jan 2012, 18:03
by atrol
Coolpro21 wrote:Mantis shot out hundreds of update emails which pissed off a couple of directors and the CIO, but they got over it once I explained the benefit of Global categories over individual categories per project.
I know, I know, I see their faces :lol:
But it's a good thing for some special kind of managers: They can show their smartphones and tell all people around: Oh my god, I received 17321 very urgent emails, excuse me for a moment, I will need about five minutes to get this solved, maybe six ....

My workaround for this:
Set the page offline, temporary add $g_enable_email_notification = OFF; to config_inc.php, do your mass operations, ...