Resolve missing attachments when migrating to cloud via Confluence Cloud Migration Assistant

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform Notice: Server and Data Center Only - This article only applies to Atlassian products on the server and data center platforms.

Summary

The Confluence Cloud Migration assistant helps you move content, users, and groups from Confluence Server to Confluence cloud. When migrating confluence spaces via the migration assistant, sometimes attachments are found missing from spaces in the destination cloud site. This is because the attachments were possibly missing from the server instance in the first place. Either the attachment file was manually deleted or there was an error in removing the record of the attachment from Confluence.

In this article, we will focus on workarounds to tackle the missing attachments issue.

Diagnosis

The following error will appear in atlassian-confluence.log

WARN [pool-12345-thread-6] [service.stepexecutor.attachment.AttachmentMigrator] warn Failed to read attachment 1234567 data. The error is unrecoverable. The attachment will be marked as broken and will not be retried.
---------
com.atlassian.migration.agent.service.stepexecutor.attachment.AttachmentDataProvider$AttachmentDataRetrievalException: Could not get attachment 1234567 data. Attachment download path: 
https://confluence_url/download/attachments/987654/file_name.extention?version=1 please open and verify
        at com.atlassian.migration.agent.service.stepexecutor.attachment.AttachmentDataProvider.lambda$getAttachmentData$0(AttachmentDataProvider.java:59)
        at com.atlassian.sal.core.transaction.HostContextTransactionTemplate$1.doInTransaction(HostContextTransactionTemplate.java:21)
        at com.atlassian.sal.spring.component.SpringHostContextAccessor$1.doInTransaction(SpringHostContextAccessor.java:71)
---------
Caused by: com.atlassian.confluence.pages.AttachmentDataNotFoundException: Problem while getting attachment stream (Attachment: file_name.extention v.1 (1234567) username) from file system
        at com.atlassian.confluence.pages.persistence.dao.filesystem.FileSystemAttachmentDataDao.getDataForAttachment(FileSystemAttachmentDataDao.java:65)
---------
Caused by: com.atlassian.confluence.pages.persistence.dao.filesystem.AttachmentDataFileSystemException: No such file for Attachment: file_name.extention v.1 (1234567) username. Were looking at /path/to/confluence/attachments/ver003/01/23/123456/34/56/pageid/attachementid/1


Resolution

If a space has any number of missing attachments, the migration for that entire space will fail. This issue needs to be resolved before migrating to Cloud.

To fix the issue before the migrating to cloud, proceed with the following steps:

  1. Open the confluence log file. Learn more about how to work with confluence logs

  2. Search for the keyword “Failed to read attachment”.

  3. Use the keyword “attachment download path” to retrieve details of the attachment path and verify if the attachment exists in confluence.

  4. If the attachment is missing, upload a new file with the same name in place of the missing attachment through the application.

  5. Use the Confluence Cloud Migration Assistant to restart the migration.

  6. After the migration is done, contact support to cross-check the attachments.

It is recommended that you fix the issue when it is first detected in the Confluence Cloud Migration Assistant. If you discover missing attachments after you have already migrated to Cloud, contact support to resolve this.


Last modified on May 11, 2021

Was this helpful?

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