jira attachments migrating from test server

Robert Nadon
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.
August 25, 2015

Hi all,

I have an unusual situation here.  I had two versions of JIRA a production and a test both being used as production.  I move everything to a single system by backup/restore of the production one and then creating a CVS file of the "test" one and restoring it into a single production.  

Everything worked good short of loosing comments and attachments.  I have copied all the attachments across to the new system.  However when you go into the copied over issues they do not know about the attachments.  

EG.   DGCLOUD-290 has the following in the attachments directory:

DGCLOUD-290/10235
DGCLOUD-290/10236
DGCLOUD-290/thumbs
DGCLOUD-290/thumbs/_thumb_10235.png

However, going into the issue and it appears to not have any attachments.   Is there a way to tell JIRA to look at the attachments directory and if there are any attachments there to attach them to the issue?

Thanks so much in advance,

Robert

 

1 answer

1 accepted

1 vote
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 25, 2015

Not really - you needed to attach the attachments at import time, as JIRA needs to populate the attachmnet table.  There's no scan ability, if you want to "repair" it, you can either upload them via a script, or try to hack them into the attachment table (Which is, of course, risky)

Robert Nadon
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.
August 25, 2015

Thanks Nic, Any thoughts or directions on how to do it with a script?

Robert Nadon
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.
August 25, 2015

Does the Bob's CLI have an Add attachment? If so I could write a unique script. You are a genius Nic. Thanks!

Robert Nadon
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.
August 25, 2015

UNIX script (maybe unique as well though...)

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 25, 2015

Yes, I'd go for Bob's CLI if you have it. I'd be tempted to try it with script-runner (mostly because I can now throw things at Jamie's team when I get stuck) and for a shell script, I think I'd try an iterated REST call to JIRA

Robert Nadon
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.
September 9, 2015

BTW I wrote a script that does: For each key in attachments for each attachment in directory use cli add $attachment to issue $key Which did everything except thumbs which was acceptable to my user base. Worked like a champ. Thanks so much for all your help @a display name !!!

Suggest an answer

Log in or Sign up to answer