This page last changed on Jan 22, 2007 by david.soul@atlassian.com.
Seeing an error when creating or importing a backup?
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 http://confluence.atlassian.com/display/DOC/Enabling+detailed+Hibernate+logging
- Once all three changes have been made, restart Confluence
- Attempt another restore
- You must now check your log files to find out what object could not be converted into XML format. Find your Confluence logs, which by default will be in your Confluence install directory under the /logs/catalina.out file. Scroll to the bottom of the file
- Find an 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.
- Go to the instance the backup was created on. You must have an instance of Confluence connected to the old database. If you do not have this, use a DBA tool to restore a manual backup of the database. If required, restore the old Confluence home and install directories.
- 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 http://confluence.atlassian.com/display/DOC/Enabling+detailed+Hibernate+logging to re-enable disable batched updates and turn off log SQL queries and log SQL queries with parameters
- Restart Confluence
To Help Prevent This Issue From Reoccuring
- 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.
RELATED TOPICS
Administrators Guide
|