Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-78860

Importing a Cloud space backup to Server fails when the source space has templates with attachments

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Low
    • None
    • 7.13.2, 7.13.7, 7.15.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

      1. Create a space in Cloud
      2. Create a new page template and insert an attachment
      3. Save the template
      4. Export the space to XML
      5. 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.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              azolkefli Athirah Zolkefli
              Votes:
              5 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated: