Fixing broken attachments after restoring a backup to another Cloud Instance

Still need help?

The Atlassian Community is here for you.

Ask the community

Summary

Documentation guides fixing broken attachments in a team-managed project converted from a company-managed project after restoring cloud backup from another instance.

Scenario

  1. Create a cloud site with Company-Managed Project
  2. Follow the Create-a-backup-for-Jira-Cloud documentation to create a backup of the cloud instance.  The backup file will look like below:

    JIRA-backup-20230523
    ├── activeobjects.xml
    ├── entities.xml
    ├── data
    │   ├── attachments
    │   └── avatars
    └── logos
  3. Split the backup into two: media (attachments, project avatars, and logos)  & database backup (entities.xml and activeobjects.xml files) 

    data-backup
    ├── activeobjects.xml
    └── entities.xml
    
    media-only
    ├── data
    │   ├── attachments
    │   └── avatars
    └── logos
  4. Compress the above two folders
  5. Restore data-backup.zip followed by media-only.zip to the new destination cloud site by following the article Import a backup file
  6. Before converting the project to a team-managed one, it's crucial to ensure that attachments load properly on the cloud. If any issues are identified after the conversion, follow the workaround below without any delay.

Fix Broken attachment post-cloud backup restoration

  1. Reach out to the Atlassian Support team to inquire about the status of the attachment on the Cloud.

  2. Check if the media store ID exists on the destination cloud site for the migrated project (Internal query for Atlassian only). 

    SELECT ji.issuenum, att.filename, ma.media_store_id
    FROM jiraissue ji
             JOIN project pro ON ji.project = pro.id
             JOIN fileattachment att ON ji.id = att.issueid
             LEFT JOIN media_store_attachments ma ON ma.attachment = att.id
    WHERE pro.pkey = 'PRJ' AND issuenum IN  IN ( '123' ) 
  3. Using the above queries support team can confirm whether the media store ID is present.

  4. If there is no media store ID then follow the steps below to restore media-only.zip to the cloud again.
    1. First, Remove all other project folders from media-only.zip and keep only the problematic one 

      media-only1
      └── data 
          └── attachments
      		└──PRJ
       		   └──10000
        		      └──PRJ-123 
    2. Go to the destination cloud site
    3. Choose Settings > System
    4. Under IMPORT AND EXPORT, select Import Jira Cloud 
    5. Click on Media Only and import the above-mentioned zip file
  5. Verify all images of imported projects are loading
Last modified on Mar 22, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.