Importing XML with attachments

Get help from other users here.

Moderators: Contributor, Developer

Importing XML with attachments

Postby mcsilver » Jul 05, 2017 3:43 pm

My goal is to migrate my JIRA tickets to MantisBT. Currently, I have all the JIRA data, sans attachment files, in an Excel file and I am writing VBA to generate an XML file that Mantis can import.

So far, so good.

Then I get to the attachments.

MantisBT version 2.5.1
schema version 209
Import/Export issues version 2.5.1

My Mantis is configured to store attachments to file (vs. to the database), which is working fine when I attach a file via the Mantis front-end. Here is my config_inc.php, if that helps:

Code: Select all
# --- Attachments / File Uploads ---
$g_allow_file_upload = ON;
$g_file_upload_method = DISK;
$g_absolute_path_default_upload_folder = '/var/www/html/attachments/'; # used with DISK, must contain trailing \ or /.

As a test of importing an attachment, I created a Mantis ticket with a note that contains an attachment, then exported it to XML, then deleted the ticket--all using the web front-end. Then imported it back; however, I got this error:


Uploaded file could not be moved to the file storage directory. Directory either does not exist or not writable to webserver.
Please use the "Back" button in your web browser to return to the previous page. There you can correct whatever problems were identified in this error or select another action. You can also click an option from the menu bar to go directly to a new section.

Here's my attachments directory, in case you want to examine its ownership and permissions:

Code: Select all
drwxrwxrwx 2 www-data www-data 4096 Jul  5 13:02 attachments/

If I switch to database storage for attachments then the import works.

My questions:

  1. Does the Import/Export issues plugin currently work for attachments when $g_file_upload_method = DISK?
  2. What is the encoding used to export attachments? Looks like Base64 but I'd like to confirm.
  3. What/where is the value that associates an attachment with its note? The only common value I see is the date, which does not seem to be all that wise, given that the dates are Epoch format, which are only accurate to the second.

With thanks!
Posts: 4
Joined: Jul 03, 2017 4:43 pm

Return to Help

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 15 guests