Can't create XML backup due to backupEntities Couldn't backup database data
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Problem
Can't create Confluence XML backup when Confluence connects to MySQL.
The following appears in the atlassian-confluence.log
2015-03-19 11:39:48,665 ERROR [http-bio-8080-exec-66] [confluence.importexport.impl.AbstractXmlExporter] backupEntities Couldn't backup database data.
-- referer: http://<URL>/admin/backup.action | url: /admin/dobackup.action | userName: user | action: dobackup
java.lang.RuntimeException: net.sf.hibernate.exception.GenericJDBCException: could not load: [com.atlassian.confluence.links.ReferralLink#14352410]
at com.atlassian.confluence.importexport.impl.HibernateObjectHandleTranslator.handleToObject(HibernateObjectHandleTranslator.java:64)
at com.atlassian.hibernate.extras.XMLDatabinder.writeObjects(XMLDatabinder.java:190)
at com.atlassian.hibernate.extras.XMLDatabinder.toGenericXML(XMLDatabinder.java:169)
at com.atlassian.confluence.importexport.impl.AtlassianXMLDatabinder.toGenericXML(AtlassianXMLDatabinder
..
Caused by: net.sf.hibernate.exception.GenericJDBCException: could not load: [com.atlassian.confluence.links.ReferralLink#14352410]
at net.sf.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:90)
at net.sf.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:79)
... 310 more
Caused by: java.sql.SQLException: Cannot convert value '0000-00-00 00:00:00' from column 6 to TIMESTAMP.
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1072)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:986)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:981)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)
..
Caused by: java.sql.SQLException: Value '[B@3efce2ce' can not be represented as java.sql.Timestamp
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1072)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:986)
Cause
In some unknown situation MySQL can't convert timestamp value and thrown mentioned error.
Workaround
Add zeroDateTimeBehavior=convertToNull
into Database's URL with following steps:
- Shut down Confluence
Edit
<Confluence Home>/confluence.cfg.xml
file and change"hibernate.connection.url"
to:jdbc:mysql://<DB URL>/<dbname>?autoReconnect=true&zeroDateTimeBehavior=convertToNull
Please replace
<DB URL>
and<dbname>
to your database URL and database name.- Start Confluence
- Try to generate a backup.
- Clear Confluence plugins cache.
- Rebuild the content indexes from scratch