You Need to Renumber Your Mantis Projects—But There's No Button for It. Now What?
You've been using Mantis Bug Tracker (MantisBT) for years. Your project list has grown organically, but now you're facing a problem: the project IDs don't match your new naming convention, you're migrating data from another system, or maybe you just wish you could clean up those auto-incremented numbers. You click through every admin screen, every configuration page, and you realize something unsettling: there's no "Edit Project ID" field. The question that follows is frustratingly simple: how to change project id in mantis?
The short answer is that Mantis does not allow you to change a project's ID through its web interface. The ID is a permanent, internal identifier assigned when the project is created [citation:1]. But if you're technically savvy and absolutely must change it—perhaps for integration with external systems or to fix a migration error—there is a way. It involves direct database manipulation, and it comes with serious risks. This guide will walk you through the process, the dangers, and the safer alternatives.
Why Project IDs Are So Stubborn (And Important)
Before you touch anything, you need to understand why Mantis guards these numbers so carefully. Every project in Mantis gets a unique ID stored in the mantis_project_table [citation:1]. This isn't just a label—it's the primary key that links the project to virtually everything else in the system:
| Database Table | What It Links |
|---|---|
mantis_bug_table |
Every issue, bug report, and task for the project [citation:1] |
mantis_project_user_list_table |
User permissions and access levels for the project [citation:1] |
mantis_project_version_table |
Versions and milestones associated with the project [citation:1] |
mantis_custom_field_project_table |
Custom fields linked to the project |
| Plugin-specific tables | Any data stored by installed plugins |
Changing the ID in one place but not another breaks these links instantly. Issues disappear, users lose access, and reports fail [citation:1]. The Mantis development team does not support direct ID changes, so if something goes wrong, you're on your own [citation:1].
Method 1: The Database Surgery (For Experts Only)
If you've weighed the risks and still need to proceed, here is the technical process for how to change project id in mantis by manipulating the database directly. This method is based on expert-level database administration and should only be attempted by someone comfortable with SQL and database backups [citation:1].
Step 1: Back Up Everything
This is non-negotiable. Before making any changes, create a full backup of your entire Mantis database. Use tools like mysqldump, phpMyAdmin, or your hosting provider's backup system [citation:1]. Store this backup somewhere safe—it's your lifeline if something goes wrong.
Step 2: Identify the Current Project ID
Log into your database management tool (phpMyAdmin, Adminer, MySQL CLI, etc.) and run a query to find the project you want to change [citation:1]:
SELECT id, name FROM mantis_project_table;
Note the current ID of the target project. Let's say it's 15 and you want to change it to 20.
Step 3: Update the Main Project Table
First, update the ID in the primary project table [citation:1]:
UPDATE mantis_project_table SET id = 20 WHERE id = 15;
Important: Ensure the new ID (20) is not already in use. Check first with SELECT id FROM mantis_project_table WHERE id = 20;
Step 4: Update All Related Tables
This is the most critical and error-prone step. You must update the project ID in every single table that references it. Here are the essential ones [citation:1]:
UPDATE mantis_bug_table SET project_id = 20 WHERE project_id = 15; UPDATE mantis_project_user_list_table SET project_id = 20 WHERE project_id = 15; UPDATE mantis_project_version_table SET project_id = 20 WHERE project_id = 15; UPDATE mantis_custom_field_project_table SET project_id = 20 WHERE project_id = 15; UPDATE mantis_bugnote_table SET project_id = 20 WHERE project_id = 15; -- If present UPDATE mantis_email_table SET project_id = 20 WHERE project_id = 15; -- If present UPDATE mantis_filters_table SET project_id = 20 WHERE project_id = 15; -- If present UPDATE mantis_news_table SET project_id = 20 WHERE project_id = 15; -- If present UPDATE mantis_sponsorship_table SET project_id = 20 WHERE project_id = 15; -- If present UPDATE mantis_tag_table SET project_id = 20 WHERE project_id = 15; -- If present UPDATE mantis_todo_table SET project_id = 20 WHERE project_id = 15; -- If present
Don't stop there. If you use any plugins, you must check their database tables for project ID references. Plugin tables often have their own naming conventions (e.g., mantis_plugin_name_table) and may store project IDs in unexpected columns [citation:1].
Step 5: Clear Caches
After updating the database, clear any system caches. Restart your web server if possible, or clear Mantis's internal cache if you use one. This ensures all references to the old ID are flushed [citation:1].
The Risks: What Can Go Wrong
Changing a project ID directly in the database is like performing heart surgery with a pocket knife. Even with careful planning, things can go wrong [citation:1]:
- Broken Foreign Key Relationships: If you miss even one table, that data becomes orphaned and inaccessible.
- Permission Loss: Users may lose access to the project if the
mantis_project_user_list_tableupdate fails. - Data Disappearance: Issues, notes, and attachments can vanish from the UI while still existing in the database.
- Plugin Failures: Plugins often store project IDs in their own tables. If you miss them, those features break silently.
- Support Void: The Mantis team does not support this procedure. If you break your installation, you're responsible for fixing it [citation:1].
Safer Alternatives to Changing Project IDs
Given the risks, most administrators should consider these safer options before attempting direct database modification [citation:1].
Alternative 1: Just Rename the Project
If your goal is cosmetic—you want the project to appear with a different name or identifier—simply rename it. Go to Manage > Manage Projects, click your project, and change the name, description, or status [citation:4]. This updates what users see without touching the underlying ID.
Alternative 2: Create a New Project and Move Issues
If you need a different ID for technical reasons, the safest approach is to create a new project with the desired name and settings, then move all issues from the old project to the new one [citation:1]. Mantis provides tools for moving issues between projects, though it may require some manual work for attachments and history.
- Create the new project via Manage > Manage Projects > Create New Project [citation:4].
- Use Mantis's built-in move functionality (or a script) to transfer all issues.
- Update user permissions for the new project.
- Once verified, archive or delete the old project.
Alternative 3: Use Custom Fields or Tags for Identification
If you need to group or identify projects in reports, consider using custom fields or tags instead of relying on the project ID [citation:1][citation:4]. Custom fields can store additional identifiers, and you can filter reports based on those values without changing core database structures.
Alternative 4: Modify Reports to Display Aliases
For reporting purposes, you can create custom reports or modify existing ones to display a "friendly" project identifier instead of the database ID. This keeps the underlying data intact while presenting the information you need [citation:1].
What the Mantis Documentation Actually Says
The official Mantis administration guide confirms that project management is done through the "Manage Projects" page, where you can change [citation:4]:
- Project name
- Description
- Status (development, release, stable, obsolete)
- Public/private visibility
- File directory for attachments
- Subprojects
- Categories
- Versions
- Custom field associations
- User assignments and access levels
Notice what's missing: project ID. The ID is intentionally excluded because it's a system-critical identifier [citation:4].
Why You Might Actually Need This (And When to Walk Away)
There are legitimate scenarios where changing a project ID becomes necessary [citation:1]:
- Data migration: Importing projects from another system with conflicting IDs.
- Integration requirements: An external system expects specific ID numbers.
- Cleanup after testing: Removing test projects and renumbering remaining ones.
But ask yourself: is this truly necessary? In most cases, the safer alternatives will achieve your goal without risking data integrity. If you proceed with direct database changes, ensure you have:
- A verified, restorable backup
- Complete documentation of all tables that might contain project IDs
- Time to thoroughly test after the change
- A rollback plan
Get free samples of Expert Knowledge
Just as you might test a product before committing, you can test your database skills on a non-production copy of your Mantis installation before attempting any changes. Think of this guide as free samples of advanced system administration knowledge—a starter kit for understanding how Mantis stores its data. By practicing on a backup first, you're giving yourself free samples of experience without risking your live system.
Conclusion: Proceed with Caution
The question how to change project id in mantis has a technical answer, but it's not the answer most administrators want to hear. Yes, it's possible by directly editing the database—updating the mantis_project_table and every related table that stores the ID [citation:1]. But the risks are substantial, and the Mantis team explicitly doesn't support this practice.
Before reaching for the SQL editor, consider whether renaming the project, moving issues, or using custom fields will achieve your goal [citation:1][citation:4]. These alternatives preserve data integrity and keep your Mantis installation stable. If you absolutely must change the ID, back up everything, document every step, and test thoroughly before trusting your production system.
Your project IDs are the backbone of your Mantis installation. Treat them with the respect they deserve.