How to back up only 1 project's data

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
Mitch

How to back up only 1 project's data

Post by Mitch »

I work in a consulting firm with several different clients. I have no problem using Mantis' built-in security to prevent one customer from seeing another customer's projects.

BUT... at the end of a project, we want to give each client a backup of their defects. How can I do a database dump for only 1 client's project?

So far we're doing this:
1) Making a dump of the entire database (to preserve the original)
2) Creating a new database and loading the dump into it
3) Using a mass of SQL statements to DELETE FROM each of the tables, to remove everything that isn't part of that clients' project. (I had to map out all of the foreign keys and data relationships to figure it out.)
4) Now that the data is sanitized, I make a dump of this database and present it to the client.

Is there an easier way? Does anyone else have the same issue, and if so, how do you handle it?

--Mitch
thraxisp
Developer
Posts: 509
Joined: 14 Feb 2005, 03:38
Location: Ottawa, Canada
Contact:

Post by thraxisp »

If you don't need the full database, you could use the Word or Excel export.
Mitch

How to back up only 1 project's data

Post by Mitch »

Unfortunately, they need the database. They want to be able to import the data into their own version of Mantis. (Or possibly into another defect database of their choosing.)
PatPowerMan
Posts: 9
Joined: 04 Mar 2005, 16:57

Post by PatPowerMan »

Is there any chance to get a database-export for a single project?
vboctor
Site Admin
Posts: 1304
Joined: 13 Feb 2005, 22:11
Location: Redmond, Washington
Contact:

Post by vboctor »

Exporting only one project and re-constructing a new database is not a trival process.

However, I would suggest the following scenario:
- Backup your database.
- Restore the backup into a new database.
- Connect a Mantis installation to the new database.
- Delete all projects except the one you want to keep. This should delete all bugs, related notes, history, attachments, etc.
- Delete all users who are irrelevant to the project you want to keep.
- Reset passwords and cookie strings for users that will remain in the database.
- Delete custom field definitions that are not used in the project you want to keep.
- Delete all news that are not relevant to the project.
- Delete all profiles / global profiles that are not relevant to the environment to which the new Mantis db is to be deployed.

I think a solution based on the above concept will be easier to implement than a customised export/import. Mayne we can have a script that can clean up a database and leave only items relevant to a specific project. This is by using the API to automate the above steps.

Regards,
Victor
Mantis Blog
http://www.futureware.biz/
Post Reply