Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,300,108
Community Members
 
Community Events
165
Community Groups

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

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 Community Leader May 07, 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

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 Community Leader May 09, 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 Community Leader May 07, 2022

Did you perform a reindex?

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

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you