Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Failed to read (x) attachments while migrating from Server to Cloud

Hello Everyone,

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.

Very common reasons why attachments cannot be found in server/DC:

  • Either the file has been deleted manually OR,

  • There was an error in removing the record of the attachment from Confluence.

 

Here are some of the steps you should follow after a failed migration because of missing attachments:

Option 1:

  • You can follow this article to resolve missing attachments before doing another migration.
  • It may happen that there are no results of the script following the above step, in that case, move to option 2.

 

Option 2:

  • 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

 

 

Option 3:

  • If none of the above options are helpful then, reach out to us raising a ticket on https://support.atlassian.com, we can help you with either deleting the bad entries or provide a dark feature to be enabled on the Confluence Server to skip those entries during the migration.

6 comments

Comment

Log in or Sign up to comment
Rodolfo Romero - Adaptavist April 13, 2021

Is there a similar procedure for Jira migration to Cloud?

Like Saif likes this
Saif
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 14, 2021

Hi @Rodolfo Romero - Adaptavist ,

Regarding attachments failure with the plugin Jira Cloud Migration Assistant, it could be any reason and cannot be concluded without checking logs

For a detailed investigation, I would recommend creating a ticket with us from https://support.atlassian.com and we will surely help you solve the issue. Make sure you provide us the logs generated by the plugin and the support zip filesmile

Thanks,

Saif

Like Sri Kumar likes this
Sri Kumar
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.
April 26, 2021

Good Article @Saif , It really helps customers to self serve themselves. 

 

Thank you,
- Sri 

Frank Szilinski May 28, 2021

We had 8 attachments when were cloud migration assistent failed. We tried to just delete the migration media-id's but that did not resolve the purpose. We checked this attachements in the pages and these had been deleted but somehow the contents where just there, but unreadable. Then we decided to just delete this 8 rows and that worked well.

 

IMPORTANT: DO NOT JUST COPY & PASTE THIS!

-- check attachmentid from media that was null and delete
select attachmentid from MIG_ATTACHMENT where mediaid is null
=> ie. you get 73105453, 73105417

-- check where the attachements are linked to
SELECT *
FROM CONTENT INNER JOIN SPACES ON CONTENT.SPACEID = SPACES.SPACEID
WHERE CONTENTTYPE = 'ATTACHMENT'
and contentid in (73105453, 73105417)

-- delete attachements
delete from contentproperties where contentid in (73105453, 73105417)
delete from imagedetails where attachmentid in (73105453, 73105417)
delete from content where contentid in (73105453, 73105417)

-- delete migration
delete from MIG_ATTACHMENT where mediaid is null

Like # people like this
Enrico Keil May 30, 2021

Thank you @Frank Szilinski 

I was in the same situation with about 100 attachments missing overall in several spaces. Atlassians python script did not help. From the filenames I could see that most of the missing files date back to the year 2013 and earlier and that these are just orphans from long before deletes pages. Removing the attachments in the databased worked great and I was able to migrate alle spaces. 

Like Saif likes this
Saif
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 6, 2021

Hi @Frank Szilinski  and @Enrico Keil

First of all thanks for checking this community article.

You are right indeed, and I have mentioned this part in the article as well that most of the time those missing attachment errors are because of some deleted/stale entries from the past which still exist in the database. Basically, the attachment is physically deleted but the reference is still there. In such cases, you can try deleting those entries from the database as already done by you or the best-recommended approach would be to reach out to us by raising a ticket from https://support.atlassian.com, we can either help you out with deleting the stale entries or provide you a dark feature that can be enabled on Server to skip those deleted/missing entries of attachments during migration.

Thanks,

Saif | Atlassian

Like Sri Kumar likes this
TAGS
AUG Leaders

Atlassian Community Events