Migrating issues with attachments from one DC Jira to another DC Jira

Maria Murphy May 7, 2022

Summary:  I am migrating a project from a Jira DC server to another Jira DC server.  When I click on the thumbnail I see the "Ouch! We can't load the image." message.  However, if I right-click and open the link in another tab, the image is displayed

Description: I have the exported CSV and a directory of attachments.    I copied the directory of attachments to the appropriate place on the destination server.  I modified the CSV to switch the attachment URL to the new server's base URL for all the attachments.  I imported all the issues.  Jira added a file for each attachment into the attachments directory which doesn't match the corresponding filename that I brought over.  For example, I copied over /usr/local/jiradata/data/attachments/MYPROJ/10000/MYPROJ-123/719984 which is a PNG. After I imported the CSV, Jira created a 11542 file in the same directory.  The filetype of this file is 'HTML document, ASCII text, with very long lines'.  If I try to click on the image link in the issue, I receive the 'Ouch!' message.  If I move 11542 aside (i.e., rename it) and either create a symbolic link called 11542 to 719984 OR copy 719984 to 11542, I see the correct attachment contents, but only if I click on the link and open it in a separate tab.  If I simply click on the link I see the 'Ouch!' message again.

Any ideas?

2 answers

0 votes
Ismael Jimoh
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 7, 2022

@Maria Murphy @When importing data in Jira please put attachments in <jira-home>/import/data/attachments

Jira doesn’t read your full path when you specify it because it always goes to its home folder by default.

Using import folder also makes this a much cleaner structure.

Regards

Maria Murphy May 8, 2022

Thanks for responding.

The CSV file puts the path for the attachments in this format in the attachments column:
<Jira base URL>/secure/attachment/<attachment ID>/<filename>

On the server, attachments are placed in:

<jira-home>/data/attachments/<PROJNAME>/10000/<ISSUE-ID>/<attachment>

To clarify, you're saying when I do the import, I should put the attachments in this path instead:

<jira-home>/import/data/attachments/<PROJNAME>/10000<ISSUE-ID>/<attachment>

and Jira will know to put them in the appropriate <jira-home>/data/attachments directories?

Ismael Jimoh
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 9, 2022

@Maria Murphy that is correct.

When you put an attachment in the <JIRA-HOME>/data/attachments folder, you are more or else confusing the instance as it needs to import attachments and link them back to the folder where they are already written to.


Don't forget that imported attachments are mapped by attachment ID from database so if this doesn't match, it also would likely not work. You will get an Attachment not Found error.

With the other, JIRA looks at the import directory, sees the attachment and copies it as part of your import into the <JIRA-HOME>/data/attachments folder assigning the ID the attachment was given in the database to each attachment imported.

Regards.

0 votes
Robert Wen_ReleaseTEAM_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 7, 2022

Did you perform a reindex?

Maria Murphy May 7, 2022

Yes, I did a project reindex and a full Jira reindex.

Suggest an answer

Log in or Sign up to answer