Confluence XML Import Issues

Find the class that the import is having issues with. For this example ContentPermission is the problem.

Error while importing backup: not-null property references a null or transient value:  
Caused by: net.sf.hibernate.PropertyValueException: not-null property references a null or transient value:

Delete all ContentPermission entries from the XML file - this will remove all unnecessary/unsupported classes and will allow the import to continue. Open the zip file and edit entities.xml

Search for <object class="ContentPermission"...> You will see <object> entries like this:

<object class="ContentPermission" package="">  
<id name="id">17072133</id>  
<property name="type"><![CDATA[View]]></property>  
<property name="userName"><![CDATA[corporatetrainer]]></property>  
<property name="groupName"/><property name="owningSet" class="ContentPermissionSet" package=""><id name="id">17039363</id>  
<property name="creatorName"><![CDATA[corporatetrainer]]></property>  
<property name="creationDate">2011-05-19 10:22:05.000</property>  
<property name="lastModifierName"><![CDATA[corporatetrainer]]></property>  
<property name="lastModificationDate">2011-05-19 10:22:05.000</property>  

Helpful on-liner to remove the entries from entities.xml

$ sed -i '/<object class="ContentPermission"/,/<\/object>/d' entities.xml

Make sure there are no syntax errors that will cause the import to fail

xmllint --noout entities.xml

Retry the import and Good Luck!

Tagged under: confluence, wiki, xml, import