Confluence 2.10 has reached end of life
Check out the [latest version] of the documentation
XML site backups are only necessary for migrating to a new database. Upgrading Confluence, Setting up a test server or Establishing a reliable backup strategy is better done with an SQL dump.
If migrating from HSQLDB to MySQL, you might have a better experience using the MySQL Migration Toolkit.
Seeing an error when creating or importing a site or space backup?
Problem |
Solution |
---|---|
Exception while creating backup |
Follow Troubleshooting failed XML site backups instead |
Exception while importing backup |
Follow instructions below |
Resolve Errors When Attempting To Restore An XML Backup
The errors may be caused by a slightly corrupt database. You will need to find the XML backup file entry that is violating the DB rules, modify the entry and recreate the XML backup:
- On the instance being restored, follow the instructions to disable batched updates (for simpler debugging), log SQL queries and log SQL queries with parameters at Enabling detailed SQL logging.
- Once all three changes have been made, restart Confluence.
- Attempt another restore.
- Once the restore fails, check your log files to find out what object could not be converted into XML format. For Confluence Standalone users, check your Confluence install directory under the
/logs/
and check bothatlassian-confluence.log
andcatalina.out
file. The correct file will contain SQL debug output. - Scroll to the bottom of the file and identify the last error relating to a violation of the database constraint. For example:
This example indicates a row in your attachment table with ID = 38 that has a null title.
2006-07-13 09:32:33,372 ERROR [confluence.importexport.impl.ReverseDatabinder] endElement net.sf.hibernate.exception.ConstraintViolationException: could not insert: [com.atlassian.confluence.pages.Attachment#38] net.sf.hibernate.exception.ConstraintViolationException: could not insert: [com.atlassian.confluence.pages.Attachment#38] ... Caused by: java.sql.SQLException: ORA-01400: cannot insert NULL into ("CONFUSER"."ATTACHMENTS"."TITLE") at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
- Go to the server that the backup was created on. You must have a copy of the database from which the backup was created. If you do not have this, use a DBA tool to restore a manual backup of the database.
- Open a DBA tool and connect to the original database instance and scan the table names in the schema. You will have to modify a row in one of these tables.
- To work out which table, open
catalina.out
, check the first line of the exception. To work out what table an object maps to in the database, here's a rough guide:- Pages, blogposts, comments --> CONTENT table.
- attachments --> ATTACHMENTS table.
- To correct the example error, go to the attachment table and find that attachment object with id 38. This will have a a null title. Give a title using the other attachments titles as a guide. You may have a different error and should modify the database accordingly.
- Once the entry has been corrected, create the XML backup again.
- Import the backup into the new version.
- If the import succeeds, revert the changes made in your SQL logging to re-enable disable batched updates and turn off log SQL queries and log SQL queries with parameters.
- Restart Confluence.
Troubleshooting "Duplicate Key" related problems
If you are encountering an error message such as:
could not insert: [bucket.user.propertyset.BucketPropertySetItem#bucket.user.propertyset.BucketPropertySetItem@a70067d3]; SQL []; Violation of PRIMARY KEY constraint 'PK_OS_PROPERTYENTRY314D4EA8'. Cannot insert duplicate key in object 'OS_PROPERTYENTRY'.; nested exception is java.sql.SQLException: Violation of PRIMARY KEY constraint 'PKOS_PROPERTYENTRY_314D4EA8'. Cannot insert duplicate key in object 'OS_PROPERTYENTRY'.
This indicates that the Primary Key constraint 'PK_OS_PROPERTYENTRY_314D4EA8' has duplicate entries in table 'OS_PROPERTYENTRY'.
You can locate the constraint key referring to 'PK_OS_PROPERTYENTRY_314D4EA8' in your table 'OS_PROPERTYENTRY' and locate any duplicate values in it and remove them, to ensure the "PRIMARY KEY" remains unique. An example query to list duplicate entries in the 'OS_PROPERTYENTRY' table is:
SELECT ENTITY_NAME,ENTITY_ID,ENTITY_KEY,COUNT(*) FROM OS_PROPERTYENTRY GROUP BY ENTITY_NAME,ENTITY_ID,ENTITY_KEY HAVING COUNT(*)>1
Troubleshooting "net.sf.hibernate.PropertyValueException: not-null" related problems
If you're receiving a message like:
ERROR [Importing data task] [confluence.importexport.impl.ReverseDatabinder] endElement net.sf.hibernate.PropertyValueException: not-null property references a null or transient value: com.atlassian.user.impl.hibernate.DefaultHibernateUser.name
This means there's an unexpected null value in a table. In the above example, the error is in the name column in the USERS table. We've also seen them in the ATTACHMENTS table.
Remove the row with the null value, redo the xml export, and reimport.
To Help Prevent this Issue from Reccuring
- If you are using the embedded database, be aware that it is bundled for evaluation purposes and does not offer full transactional integrity in the event of sudden power loss, which is why an external database is recommended for production use. You should migrate to an external database.
- If you are using an older version of Confluence than the latest, you should consider upgrading at this point.
The problem with different settings for case sensitivity varies between databases. The case sensitivity of the database is usually set through the collation that it uses. Please vote on the existing issue
RELATED TOPICS
Troubleshooting failed XML site backups
Administrators Guide