This page last changed on Nov 16, 2006 by david.soul@atlassian.com.
If creating an XML backup of Confluence fails with a stack trace error similar to this, your database has become slightly corrupted. This is likely to have occurred while using the embedded database. 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.
To correct the corruption, increase the level of logging to identify the cause and manually correct any invalid entries in the database. To do this:
- Shutdown Confluence.
- Open the confluence/WEB-INF/classes/log4j.properties and add this to the bottom and save:
log4j.logger.com.atlassian.confluence.importexport.impl.XMLDatabinder=DEBUG, confluencelog
log4j.additivity.com.atlassian.confluence.importexport.impl.XMLDatabinder=false
- Restart Confluence and begin a backup.
- When the backup fails, the error will be logged to the log files. Open the most recent log and review the stack track of the error for information identifying the object causing the failure. Here's an example error you can use to identify the database object:
This excerpt from a log file shows that there was an error trying to confer the ContentPermission object with id 5 into XML. The database object is a row in the CONTENTLOCK table with id = 5 and reset CONTENT column property so that it no longer points to the id 2535 (the id of an entry that no longer exists). If you are wondering which table a certain object is stored in, here's a rough guideline: Pages, blogposts, comments are stored in the CONTENT table, attachments in the ATTACHMENTS table.
- Using a database administrative tool, login ot the Confluence database. Locate the row in the relevant table and correct the entry. Check other rows in the table for the default column value, which may be null, 0 or blank. Overwrite the invalid row value with the default.
- Once the database has been updated, restart Confluence and reattempt the backup.
- To help prevent this issue from reoccurring - If you are using the embedded database, you should migrate to an external database.
- To help prevent this issue from reoccuring - If you are using an older version of Confluence than the latest), you should consider upgrading at this point.
|