I am creating this article to address a very common issue related to the migration of spaces using Confluence Cloud Migration Assistant aka CCMA: Failed to read XYZ attachments.
You might have come across an issue when migrating spaces from Server/DC to Cloud using CCMA, where some attachments are failing to read and the migration of space fails.
Either the file has been deleted manually OR,
There was an error in removing the record of the attachment from Confluence.
Verify if there attachments that are causing the missing attachment issue but can’t be found in the pages. These are attachments that were deleted in confluence and the files are not physically found in the system.
-- -- Select attachments with 'DELETED' in CONTENT_STATUS column
SELECT CONTENTID FROM CONTENT INNER JOIN SPACES ON CONTENT.SPACEID = SPACES.SPACEID WHERE SPACES.SPACEKEY = 'YOUR_SPACE_KEY' AND CONTENTTYPE = 'ATTACHMENT' AND CONTENT_STATUS = 'DELETED')
If there are any results to the above query, run the below query to delete those missing attachments:
DELETE FROM MIG_ATTACHMENT WHERE ATTACHMENTID IN (SELECT CONTENTID FROM CONTENT INNER JOIN SPACES ON CONTENT.SPACEID = SPACES.SPACEID WHERE SPACES.SPACEKEY = 'YOUR_SPACE_KEY' AND CONTENTTYPE = 'ATTACHMENT' AND CONTENT_STATUS = 'DELETED')
You will need to delete attachments from previously failed migration. CCMA adds an entry in the MIG_ATTACHMENT table but sets the mediaId to NULL Those entries need to be deleted. Use the query below.
DELETE FROM MIG_ATTACHMENT WHERE mediaId IS NULL and cloudId = 'XXXXX’
If still, you run into the same issues, raise a support ticket with the Migrations team from https://support.atlassian.com
...enefit is best! And don’t forget about the tried and true! Cloud Migration Center - central hub for all things Atlassian Migration Program. Includes links to our full resources page, s...
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