Details
-
Bug
-
Resolution: Unresolved
-
Low
-
None
-
7.13.2, 7.13.7, 7.15.1
-
16
-
Severity 3 - Minor
-
1
-
Description
Issue Summary
Confluence Cloud allows you to add attachments to page templates in a space, whereas Confluence on-premise does not. When you generate a space backup for one of those Cloud spaces and import it to a Server/DC instance, the restoration will fail with this error.
Import failed. Check your server logs for more information. com.atlassian.confluence.importexport.ImportExportException: Unable to complete import: Error while importing backup: com.atlassian.confluence.pages.templates.TemplateAttachment
This is reproducible on Data Center: Yes
Steps to Reproduce
- Create a space in Cloud
- Create a new page template and insert an attachment
- Save the template
- Export the space to XML
- Import the space backup to Confluence Server/DC
Expected Results
The restoration should complete successfully.
Actual Results
The restoration fails with this error in the UI:
The below exception is thrown in the atlassian-confluence.log file:
2022-05-18 16:17:51,363 ERROR [Long running task: Importing data] [confluence.importexport.xmlimport.DefaultImportProcessor] persist Error while saving object: Imported[com.atlassian.confluence.pages.templates.TemplateAttachment] [Id[id]=2293771, Property[hibernateVersion]=1, Property[name]=image.jpg, Property[version]=1, Property[pageTemplate]=com.atlassian.confluence.pages.templates.PageTemplate[Id[id]=2293761], Property[templateAttachmentProperties]=, Property[creator]=com.atlassian.confluence.user.ConfluenceUserImpl[Id[key]=557057:2e262ef9-fefc-49b7-b917-b53e52467cd0], Property[creationDate]=2022-05-17 14:22:59.620, Property[lastModifier]=com.atlassian.confluence.user.ConfluenceUserImpl[Id[key]=557057:2e262ef9-fefc-49b7-b917-b53e52467cd0], Property[lastModificationDate]=2022-05-17 14:22:59.620] -- url: /c7132/admin/restore.action | referer: http://localhost:27132/c7132/admin/backup.action | traceId: 047f174f3e38b697 | userName: admin | action: restore 2022-05-18 16:17:51,364 ERROR [Long running task: Importing data] [confluence.importexport.xmlimport.BackupImporter] importEntities Cannot import the entities: -- url: /c7132/admin/restore.action | referer: http://localhost:27132/c7132/admin/backup.action | traceId: 047f174f3e38b697 | userName: admin | action: restore com.atlassian.confluence.importexport.ImportExportException: Unable to complete import: Error while importing backup: com.atlassian.confluence.pages.templates.TemplateAttachment ... Caused by: org.xml.sax.SAXException: Error while importing backup: com.atlassian.confluence.pages.templates.TemplateAttachment java.lang.ClassNotFoundException: com.atlassian.confluence.pages.templates.TemplateAttachment
Note
The reason why this happens is because Confluence on-premise doesn't support adding attachments to templates. This is being tracked in CONFSERVER-8892.
You can instead add attachments to a different page and reference those attachments in the template's body.
Workaround
In the Confluence Cloud instance, identify any attachments in the space's templates and remove them. Generate a new space backup and the import should complete successfully.