Importing XML with attachments

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
mcsilver
Posts: 4
Joined: 03 Jul 2017, 21:43

Importing XML with attachments

Post by mcsilver »

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.

FYI
MantisBT version 2.5.1
Linux
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:
APPLICATION ERROR #505

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!
Craig
aloist
Posts: 2
Joined: 13 Mar 2019, 14:20

Re: Importing XML with attachments

Post by aloist »

I have the same problem.

$g_allow_file_upload = ON;
$g_file_upload_method = DISK; # or DISK
$g_absolute_path_default_upload_folder = '/www/docs/mantisbt/uploads';

directory permissions are for access by web server

I get:


APPLICATION ERROR #505

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.
aloist
Posts: 2
Joined: 13 Mar 2019, 14:20

Re: Importing XML with attachments

Post by aloist »

moderator, you can drop my post.
I realized that I had missed the trailing / i the path
cas
Posts: 1587
Joined: 11 Mar 2006, 16:08
Contact:

Re: Importing XML with attachments

Post by cas »

Good that you resolved the issue :mrgreen:
Post Reply