I've been running a Confluence installation (using a personal license) for a couple years. Recently, I've been experiencing some issues with it, and figured that it might be time to upgrade (from version 2.2.5, which is from July 2006, I'm guessing). At the time of this writing, the current version (and the version to which I wanted to upgrade), is version 2.10.
My upgrade process consisted of performing a clean install of version 2.10 and importing a backup of the content from my version 2.2.5 installation. According to the documentation, this is an expected and supported operation for these version numbers. But, it did not work. The error I received (in the atlassian-confluence.log file):
2008-12-20 12:00:56,428 WARN [Importing data task] [confluence.importexport.impl.ImportedProperty] saveLiteralProperty Unable to set property 'owner' on instance of 'class com.atlassian.confluence.pages.Draft' with id 13. This is probably due to internal data structure changes and doesn't cause any data loss.
-- referer: http://localhost:8080/wiki/setup/setup-restore-start.action | url: /wiki/setup/setup-restore.action | userName: anonymous | action: setup-restore
2008-12-20 12:00:56,430 WARN [Importing data task] [confluence.importexport.impl.ImportedProperty] saveLiteralProperty Unable to set property 'type' on instance...
2008-12-20 12:00:56,431 WARN [Importing data task] [confluence.importexport.impl.ImportedProperty] saveLiteralProperty Unable to set property 'spaceKey' on instance...
2008-12-20 12:00:56,436 WARN [Importing data task] [confluence.importexport.impl.ImportedProperty] saveLiteralProperty Unable to set property 'savedDate' on instance...
2008-12-20 12:00:56,945 WARN [Importing data task] [confluence.importexport.impl.ImportedProperty] saveLiteralProperty Unable to set property 'owner' on instance of 'class com.atlassian.confluence.pages.Draft' with id 14. This is probably due to internal data structure changes and doesn't cause any data loss.
-- referer: http://localhost:8080/wiki/setup/setup-restore-start.action | url: /wiki/setup/setup-restore.action | userName: anonymous | action: setup-restore
2008-12-20 12:00:56,946 WARN [Importing data task] [confluence.importexport.impl.ImportedProperty] saveLiteralProperty Unable to set property 'type' on instance...
2008-12-20 12:00:56,946 WARN [Importing data task] [confluence.importexport.impl.ImportedProperty] saveLiteralProperty Unable to set property 'spaceKey' on instance...
2008-12-20 12:00:56,946 WARN [Importing data task] [confluence.importexport.impl.ImportedProperty] saveLiteralProperty Unable to set property 'savedDate' on instance...
2008-12-20 12:00:58,660 WARN [Importing data task] [confluence.importexport.impl.ReverseDatabinder] writeObject Found duplicate key: class = com.atlassian.confluence.core.BodyContent, id = 2, skipping second object in import
-- referer: http://localhost:8080/wiki/setup/setup-restore-start.action | url: /wiki/setup/setup-restore.action | userName: anonymous | action: setup-restore
2008-12-20 12:00:58,788 ERROR [Importing data task] [sf.hibernate.util.JDBCExceptionReporter] logExceptions Duplicate entry '14' for key 1
-- referer: http://localhost:8080/wiki/setup/setup-restore-start.action | url: /wiki/setup/setup-restore.action | userName: anonymous | action: setup-restore
...
net.sf.hibernate.exception.ConstraintViolationException: could not insert: [com.atlassian.confluence.pages.Page#14]
-- referer: http://localhost:8080/wiki/setup/setup-restore-start.action | url: /wiki/setup/setup-restore.action | userName: anonymous | action: setup-restore
net.sf.hibernate.exception.ConstraintViolationException: could not insert: [com.atlassian.confluence.pages.Page#14]
at net.sf.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:73)
at net.sf.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
at net.sf.hibernate.persister.AbstractEntityPersister.convert(AbstractEntityPersister.java:1331)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:472)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:436)
at net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:37)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2449)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2435)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2392)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2261)
at com.atlassian.confluence.importexport.impl.ReverseDatabinder.flushIfNeeded(ReverseDatabinder.java:532)
at com.atlassian.confluence.importexport.impl.ReverseDatabinder.writeObject(ReverseDatabinder.java:505)
...
Caused by: com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Duplicate entry '14' for key 1
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:931)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870)
I did some Googling, but wasn't able to find a solution. I looked closer at the information contained in the log and guessed that there were really only two records at issue, and that they both were drafts:
instance of 'class com.atlassian.confluence.pages.Draft' with id 13.
instance of 'class com.atlassian.confluence.pages.Draft' with id 14.
I opened the Confluence entities.xml file (located in the back-up zip) and searched for "draft". As hoped, I found two elements:
<object class="Draft" package="com.atlassian.confluence.pages">
<id name="id">13</id>
<property name="pageId"><![CDATA[441]]></property>
<property name="owner"><![CDATA[admin]]></property>
<property name="type"><![CDATA[page]]></property>
<property name="spaceKey"><![CDATA[dev]]></property>
<property name="title"><![CDATA[FreeMarker Notes]]></property>
<property name="content"><![CDATA[content... content... content]]></property>
<property name="savedDate">2007-07-18 13:02:04.000</property>
<property name="originalVersion">3</property>
</object>
<object class="Draft" package="com.atlassian.confluence.pages">
<id name="id">14</id>
<property name="pageId"><![CDATA[700]]></property>
<property name="owner"><![CDATA[admin]]></property>
<property name="type"><![CDATA[page]]></property>
<property name="spaceKey"><![CDATA[dev]]></property>
<property name="title"><![CDATA[Blah Project - Reviews]]></property>
<property name="content"><![CDATA[content... content... content]]></property>
<property name="savedDate">2008-06-16 18:17:37.000</property>
<property name="originalVersion">19</property>
</object>
I deleted these two elements from the XML file, re-zipped the back-up, re-executed the import, and it worked perfectly.
Leave a comment