Fixing broken attachments after restoring a backup to another Cloud Instance
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
- Create a cloud site with Company-Managed Project
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
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
- Compress the above two folders
- Restore data-backup.zip followed by media-only.zip to the new destination cloud site by following the article Import a backup file
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
Reach out to the Atlassian Support team to inquire about the status of the attachment on the Cloud.
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' )
Using the above queries support team can confirm whether the media store ID is present.
- If there is no media store ID then follow the steps below to restore media-only.zip to the cloud again.
First, Remove all other project folders from media-only.zip and keep only the problematic one
media-only1 └── data └── attachments └──PRJ └──10000 └──PRJ-123
- Go to the destination cloud site
- Choose Settings > System
- Under IMPORT AND EXPORT, select Import Jira Cloud
- Click on Media Only and import the above-mentioned zip file
- Verify all images of imported projects are loading