Mantis 1.2.8 Batch Delete Categories

Post about your customizations to share with others.

Moderators: Developer, Contributor

Mantis 1.2.8 Batch Delete Categories

Postby Coolpro21 » Jan 25, 2012 5:35 pm

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?
Coolpro21
 
Posts: 10
Joined: Dec 12, 2011 4:23 pm

Re: Mantis 1.2.8 Batch Delete Categories

Postby atrol » Jan 25, 2012 6:29 pm

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.
Please use Search before posting and read the Manual
Use Mantis2Go to try MantisBT on Windows or to reproduce issues
atrol
Site Admin
 
Posts: 4719
Joined: Mar 26, 2008 4:37 pm
Location: Germany

Re: Mantis 1.2.8 Batch Delete Categories

Postby Coolpro21 » Jan 27, 2012 10:52 am

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.
Coolpro21
 
Posts: 10
Joined: Dec 12, 2011 4:23 pm

Re: Mantis 1.2.8 Batch Delete Categories

Postby atrol » Jan 27, 2012 1:03 pm

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, ...
Please use Search before posting and read the Manual
Use Mantis2Go to try MantisBT on Windows or to reproduce issues
atrol
Site Admin
 
Posts: 4719
Joined: Mar 26, 2008 4:37 pm
Location: Germany


Return to Customizations

Who is online

Users browsing this forum: No registered users and 4 guests