Page 1 of 1

attachment import

Posted: 15 Oct 2009, 06:49
by Kugelfisch
Hello,

i'm currently developing a converter from Rational Clearquest to Mantis for my Company.
I've managed to get everything to work (bugs are imported with correct date desc and so on) except the attachments.

The ImportXML Plugin has been rewritten for this purpose.
So currently the bug is created with the data from the .xml file and I get the path to the attachment.

Now my Problem:
To make it short, I can't upload the attachment because the function file_add() expects an array.
I currently only have the bug ID and the Path to the attachment.
Is there a way to create the necessary information expected by file_add() with these informations?

regards,

Haynes

Re: attachment import

Posted: 15 Oct 2009, 07:55
by vboctor
The easiest way would be to setup MantisBT to use DISK for attachment storage.

Here are the steps I recommend:

1. Setup MantisBT to use DISK attachments.
2. Place the attachment in the appropriate upload path for the project.
3. Insert a record into the DB that refers to the file (see the last 10 lines of core/file_api.php file_add() function).
4. Insert the history record if required and touch up the bug last updated time. [optional]

Re: attachment import

Posted: 15 Oct 2009, 10:45
by Kugelfisch
Thanks for the quick reply vboctor :)

I managed to import an attachment :)
It still needs some tuning to import all attachments, but it's a start.

The only "problem" I have now is a cosmetical thing. Scince I can't use the $_FILES variable I currently can't get the filetype of the file.
I'm currently using the php function filetype() but it only returns "file" as a value.
Any ideas how to solve this?

Re: attachment import

Posted: 01 Apr 2010, 02:05
by jsiegel5
Hi Kugelfisch,
Any chance you could share your Clearquest -> Mantis converter? I need to do the same thing.
Regards,
Jeff

Clearquest to Mantis BT Migration

Posted: 21 Nov 2011, 23:07
by swapna
Hi,

I am looking for a clearquest to mantis Bt migration. Please any one the process of this migration please share..
I am pretty new to Mantis.

I have installed the Mantis 1.2.8 and Mysql.

Thanks in advance!