Use Space/Site XML export entities.xml to find Confluence objects

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.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

 

Summary

Use Space/Site XML export entities.xml to find Confluence objects(Pages, UserInfo etc.)

Find Confluence Page details:

Find the latest version of the page from the entities.xml

A current version of a page will have a collection named historicalVersions containing elements having page ids of its older versions.
For example, a current page with ID 1114114 in the below instance of class Page has a collection named historicalVersions, which consists of 2 elements with the page id 1474561 and 1114121, which are its older versions.

<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1114114</id>
<property name="hibernateVersion">18</property>
<property name="title"><![CDATA[Page1]]></property>
<property name="lowerTitle"><![CDATA[page1]]></property>
<collection name="bodyContents" class="java.util.Collection"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1179649</id>
</element>
</collection>
<collection name="contentProperties" class="java.util.Collection"><element class="ContentProperty" package="com.atlassian.confluence.content"><id name="id">1146884</id>
</element>
<element class="ContentProperty" package="com.atlassian.confluence.content"><id name="id">1540102</id>
</element>
<element class="ContentProperty" package="com.atlassian.confluence.content"><id name="id">1146903</id>
</element>
<element class="ContentProperty" package="com.atlassian.confluence.content"><id name="id">1146885</id>
</element>
<element class="ContentProperty" package="com.atlassian.confluence.content"><id name="id">1146886</id>
</element>
</collection>
<property name="version">3</property>
<property name="creator" class="ConfluenceUserImpl" package="com.atlassian.confluence.user"><id name="key"><![CDATA[2cb280837b59e6ab017b59e818c90000]]></id>
</property>
<property name="creationDate">2023-05-08 12:07:11.690</property>
<property name="lastModifier" class="ConfluenceUserImpl" package="com.atlassian.confluence.user"><id name="key"><![CDATA[2cb280837b59e6ab017b59e818c90000]]></id>
</property>
<property name="lastModificationDate">2023-05-09 12:27:33.912</property>
<property name="versionComment"><![CDATA[]]></property>
<collection name="historicalVersions" class="java.util.Collection"><element class="Page" package="com.atlassian.confluence.pages"><id name="id">1474561</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1114121</id>
</element>
</collection>
<property name="contentStatus"><![CDATA[current]]></property>
<property name="space" class="Space" package="com.atlassian.confluence.spaces"><id name="id">98306</id>
</property>
<property name="position"/><property name="parent" class="Page" package="com.atlassian.confluence.pages"><id name="id">65574</id>
</property>
<collection name="ancestors" class="java.util.List"><element class="Page" package="com.atlassian.confluence.pages"><id name="id">65574</id>
</element>
</collection>
</object> 


Retrieve the body content of a page from entities.xml:

The instances of BodyContent class in the entities.xml contains the below properties, which link different contents to its data.

  • body - this holds the data of the content.
  • content - this holds the type of content and its ID.

In the below example, the bodycontent object with ID 1179649 holds the body of a page with content ID 1114114. This page also contains a macro as the body property has a structured-macro tag.

A page's body can be repeated and found linked to multiple page IDs due to the historical version of the page.
So, for example, if the page with ID 1114114 has two older versions, you would find its body repeated with some change, with two more bodycontent objects having different page IDs.

// Example from our lab instance of Bodycontent object type from entities.xml.
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1179649</id>
<property name="body"><![CDATA[<ac:structured-macro ac:name="section" ac:schema-version="1" ac:macro-id="408a1356-50d4-4b4f-a102-e854fb736bfd"><ac:parameter ac:name="border">true</ac:parameter><ac:rich-text-body><p>Test 1 </p></ac:rich-text-body></ac:structured-macro><ac:structured-macro ac:name="section" ac:schema-version="1" ac:macro-id="de2387ac-1549-40bb-b1c7-b0eaf50ccb6e"><ac:rich-text-body><p>test2</p></ac:rich-text-body></ac:structured-macro>]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1114114</id>
</property>
<property name="bodyType">2</property>
</object>



Last modified on Aug 25, 2023

Was this helpful?

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