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

Confluence Cloud Space exports with Space templates that have 'full-width' template properties break Space imports into Confluence Server/DC.

XMLWordPrintable

      Problem

      Space XML exports from Confluence Cloud which have Space templates that contain 'full-width' template properties will cause Space imports into Confluence Server/DC to break, possibly causing a partial import.

      Environment

      • Space export from Confluence Cloud, which contains templates that have 'full-width' TemplateProperty classes.
      • Tested in Confluence Server/DC v7.19.1, but could be any current version of Confluence Server/Data Center (7+)

      Steps to Reproduce

      Expected Results

      The space imports without issue.

      Actual Results

      The importer fails after the 'TemplateProperty' XML is read with the following error in the application logs:

      2022-09-30 15:21:26,555 ERROR [Long running task: Importing data] [confluence.importexport.xmlimport.BackupImporter] importEntities Cannot import the entities: 
       -- url: /c7191/admin/restore-local-file.action | referer: http://localhost:27191/c7191/admin/backup.action | traceId: 6d792714d69ba9d6 | userName: admin | action: restore-local-file
      com.atlassian.confluence.importexport.ImportExportException: Unable to complete import: Error while importing backup: com.atlassian.confluence.pages.templates.TemplateProperty
      	at com.atlassian.confluence.importexport.xmlimport.DefaultXmlImporter.doImportInternal(DefaultXmlImporter.java:68)
      ...
      

      Workaround

      1. Export the Confluence Cloud export.
      2. Uncompress the export .zip.
      3. Create a quick backup of entities.xml.
      4. Edit the entities.xml file and remove all <OBJECT> and <COLLECTION> XML blocks that use class="TemplateProperty". For instance, this whole block should be removed as it pertains to all data within it which uses class="TemplateProperty" within the scope of the <OBJECT> and </OBJECT> tags:
        <object class="TemplateProperty" package="com.atlassian.confluence.pages.templates">
        <id name="id">1376257</id>
        <property name="hibernateVersion">2</property>
        <property name="name"><![CDATA[content-appearance]]></property>
        <property name="value"><![CDATA[full-width]]></property>
        <property name="version">2</property>
        <collection name="historicalVersions" class="java.util.Collection(com.atlassian.confluence.pages.templates.TemplateProperty.historicalVersions)"><element class="TemplateProperty" package="com.atlassian.confluence.pages.templates"><id name="id">1605633</id>
        </element>
        </collection>
        <property name="pageTemplate" class="PageTemplate" package="com.atlassian.confluence.pages.templates"><id name="id">1343489</id>
        </property>
        <property name="creator" class="ConfluenceUserImpl" package="com.atlassian.confluence.user"><id name="key"><![CDATA[557057:ffd3d61c-ced9-46cb-a52a-c70b4da7c474]]></id>
        </property>
        <property name="creationDate">2022-10-14 15:27:19.448</property>
        <property name="lastModifier" class="ConfluenceUserImpl" package="com.atlassian.confluence.user"><id name="key"><![CDATA[557057:ffd3d61c-ced9-46cb-a52a-c70b4da7c474]]></id>
        </property>
        <property name="lastModificationDate">2022-10-14 16:11:07.069</property>
        </object>
        
      5. Once all of these <OBJECT> blocks pertaining to class="TemplateProperty" have been removed, save the entities.xml.
      6. Zip up the whole content of the uncompressed folder into a zip. Be sure to make sure that the contents are not added into a top-level folder when compressing. i.e. entities.xml and exportDescriptor.properties need to be on the root level of the zip.
      7. <OPTIONAL> If you have already imported this space once and it failed midway through, you can use After a failed space import, it's not possible to re-import because of leftover space data KB to delete this space from the DB. Be sure to shutdown Confluence and take a backup of the DB before updating the DB!
      8. Import the Space zip into your Confluence DC instance.

      Notes

      • Setting the 'full-width' back to 'default' does not seem to work for Space templates, runs across the same error on the importer.
      • After running the workaround and importing the Space into Confluence Server/DC, pages that used the Space template will retain the user-generated formatting, but not the Space template formatting, so you will need to manually fix this in the editor.
      • For the workaround, no user-created data is altered, we are simply removing the properties for the Space template which have the unsupported values, the data will remain. For templates that do NOT use full-width will import as normal, assuming that the class="TemplateProperty" XML doesn't exist for that template in the entities.xml.

            ephillips@atlassian.com Edward
            dmaye@atlassian.com David Maye
            Votes:
            4 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: