Export/Import a space on a different confluence server

Service CNS October 29, 2019

Hello,

 

I have a problem during the import of a specific space on my new confluence server.

(It works with some spaces but not all)

I export a space from 6.3.3 confluence server to a new (7.0.1)

I had this error : 

2019-10-29 14:36:37,690 ERROR [Long running task: Importing data] [engine.jdbc.spi.SqlExceptionHelper] logExceptions Incorrect string value: '\xF0\x9F\x98\x8A</...' for column 'BODY' at row 1
-- url: /admin/restore.action | referer: http://server:8090/admin/backup.action | traceId: d4e9c3c47c95379f | userName: cns-local | action: restore
2019-10-29 14:36:37,745 ERROR [Long running task: Importing data] [confluence.importexport.xmlimport.DefaultImportProcessor] persist Error while saving object: Imported[com.atlassian.confluence.internal.relations.dao.User2ContentRelationEntity] [Id[id]=23758026, Property[targetContent]=com.atlassian.confluence.pages.Page[Id[id]=23823085], Property[sourceContent]=com.atlassian.confluence.user.ConfluenceUserImpl[Id[key]=8ab980906836cc0f01683c37af470000], Property[targetType]=com.atlassian.confluence.internal.relations.RelatableEntityTypeEnum[PAGE], Property[relationName]=collaborator, Property[creationDate]=2019-02-20 17:00:23.161, Property[lastModificationDate]=2019-02-20 17:00:23.161, Property[creator]=com.atlassian.confluence.user.ConfluenceUserImpl[Id[key]=8ab980906836cc0f01683c37af470000], Property[lastModifier]=com.atlassian.confluence.user.ConfluenceUserImpl[Id[key]=8ab980906836cc0f01683c37af470000]]
-- url: /admin/restore.action | referer: http://server:8090/admin/backup.action | traceId: d4e9c3c47c95379f | userName: cns-local | action: restore
2019-10-29 14:36:37,747 ERROR [Long running task: Importing data] [confluence.importexport.xmlimport.BackupImporter] importEntities Cannot import the entities:
-- url: /admin/restore.action | referer: http://server:8090/admin/backup.action | traceId: d4e9c3c47c95379f | userName: cns-local | action: restore
com.atlassian.confluence.importexport.ImportExportException: Unable to complete import: Error while importing backup: could not execute statement
at com.atlassian.confluence.importexport.xmlimport.DefaultXmlImporter.doImportInternal(DefaultXmlImporter.java:64)
....
at java.lang.Thread.run(Thread.java:748)
Caused by: org.xml.sax.SAXException: Error while importing backup: could not execute statement
net.sf.hibernate.exception.GenericJDBCException: could not execute statement
at com.atlassian.confluence.importexport.xmlimport.parser.BackupParser.endElement(BackupParser.java:44)
....
at com.atlassian.confluence.importexport.xmlimport.DefaultXmlImporter.doImportInternal(DefaultXmlImporter.java:51)
... 40 more
Caused by: net.sf.hibernate.exception.GenericJDBCException: could not execute statement
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:147)
...
at com.atlassian.confluence.importexport.xmlimport.parser.BackupParser.endElement(BackupParser.java:42)
... 52 more
Caused by: java.sql.SQLException: Incorrect string value: '\xF0\x9F\x98\x8A</...' for column 'BODY' at row 1
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:965)
....
at com.atlassian.hibernate.util.SessionHelper.flushAllowNoTransaction(SessionHelper.java:80)
... 58 more
2019-10-29 14:36:37,755 WARN [Long running task: Importing data] [confluence.impl.hibernate.ConfluenceHibernateTransactionManager] doRollback Performing rollback. Transactions:
[com.atlassian.confluence.importexport.DefaultImportExportManager.performImport]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT (Session #14703620)
->[null]: PROPAGATION_REQUIRES_NEW,ISOLATION_DEFAULT (Session #1790338970)
-- url: /admin/restore.action | referer: http://server:8090/admin/backup.action | traceId: d4e9c3c47c95379f | userName: cns-local | action: restore
2019-10-29 14:36:37,846 ERROR [Long running task: Importing data] [confluence.importexport.actions.ImportLongRunningTask] runInternal Failure during import
-- url: /admin/restore.action | referer: http://server:8090/admin/backup.action | traceId: d4e9c3c47c95379f | userName: cns-local | action: restore
com.atlassian.confluence.importexport.ImportExportException: com.atlassian.confluence.importexport.ImportExportException: Unable to complete import: Error while importing backup: could not execute statement
at com.atlassian.confluence.importexport.xmlimport.BackupImporter.importEntities(BackupImporter.java:406)
...
at java.lang.Thread.run(Thread.java:748)
Caused by: com.atlassian.confluence.importexport.ImportExportException: Unable to complete import: Error while importing backup: could not execute statement
at com.atlassian.confluence.importexport.xmlimport.DefaultXmlImporter.doImportInternal(DefaultXmlImporter.java:64)
at com.atlassian.confluence.importexport.xmlimport.DefaultXmlImporter.doImport(DefaultXmlImporter.java:42)
at com.atlassian.confluence.importexport.xmlimport.BackupImporter.importEntities(BackupImporter.java:398)
... 38 more
Caused by: org.xml.sax.SAXException: Error while importing backup: could not execute statement
net.sf.hibernate.exception.GenericJDBCException: could not execute statement
at com.atlassian.confluence.importexport.xmlimport.parser.BackupParser.endElement(BackupParser.java:44)
...
at com.atlassian.confluence.importexport.xmlimport.DefaultXmlImporter.doImportInternal(DefaultXmlImporter.java:51)
... 40 more
Caused by: net.sf.hibernate.exception.GenericJDBCException: could not execute statement
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:147)
....
at com.atlassian.confluence.importexport.xmlimport.parser.BackupParser.endElement(BackupParser.java:42)
... 52 more
Caused by: java.sql.SQLException: Incorrect string value: '\xF0\x9F\x98\x8A</...' for column 'BODY' at row 1
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:965)
...
at com.atlassian.hibernate.util.SessionHelper.flushAllowNoTransaction(SessionHelper.java:80)
... 58 more

 

Do you know why ? Can you help me ? :)

2 answers

0 votes
Service CNS November 12, 2019

Hello,

 

Any update ?

 

Thanks

 

Regards,

CNS

0 votes
Manisha Kharga _Appfire_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 29, 2019

Hi @Service CNS ,

To perform this action you can use Bon Swift app Confluence Command Line Interface (CLI)

The CLI actions --exportSpace can export the space from the Source instance and then restore the space using the --restoreExport action on Target instance.

This will also retain the Author details of the source pages, Page history and Attachment history.

 ./acli.sh --action exportSpace  --space "XXX"  --file "space.zip"
./acli.sh --action restoreExport  --file "space.zip" 
 

 

Thanks,
Manisha

Service CNS October 31, 2019

Hello @Manisha Kharga _Appfire_ 

Thanks for you reply.

 

When I try to export a space I have this error :

 

URL requested: http://MyserverURL:8090/doauthenticate.action?password=***&authenticate=Confirm&destination=%2Fadmin
Request type: GET
Content type: text/html
Response code: 200, message: null, url: http://MyserverURL:8090/admin/console.action
URL requested: http://MyserverURL:8090/admin/restore-local-file.action?localFileName=exportCommXml.zip&edit=Import&buildIndex=true&buildIndexLocalFileRestore=true
Request type: POST
Content type: application/url_encoded
Response code: 200, message: null, url: http://MyserverURL:8090/admin/restore-local-file.action?localFileName=exportCommXml.zip&edit=Import&buildIndex=true&buildIndexLocalFileRestore=true
Long running task: f9dd16c7-4a63-449e-af83-1897bfb4d8ed
URL requested: http://MyserverURL:8090/longrunningtaskxml.action?taskId=f9dd16c7-4a63-449e-af83-1897bfb4d8ed
Request type: GET
Content type: text/html
Response code: 200, message: null, url: http://MyserverURL:8090/longrunningtaskxml.action?taskId=f9dd16c7-4a63-449e-af83-1897bfb4d8ed
Restore has been started with taskId f9dd16c7-4a63-449e-af83-1897bfb4d8ed. Task status can be checked at http://MyserverURL:8090/rest/api/latest/longtask/f9dd16c7-4a63-449e-af83-1897bfb4d8ed.
URL requested: http://MyserverURL:8090/rest/api/latest/longtask/f9dd16c7-4a63-449e-af83-1897bfb4d8ed
Request type: GET
Content type: application/json; charset=utf-8
Response code: 200, message: null, url: http://MyserverURL:8090/rest/api/latest/longtask/f9dd16c7-4a63-449e-af83-1897bfb4d8ed

Waiting for task completion: 0% complete. Starting...
URL requested: http://MyserverURL:8090/rest/api/latest/longtask/f9dd16c7-4a63-449e-af83-1897bfb4d8ed
Request type: GET
Content type: application/json; charset=utf-8
Response code: 200, message: null, url: http://MyserverURL:8090/rest/api/latest/longtask/f9dd16c7-4a63-449e-af83-1897bfb4d8ed
.URL requested: http://MyserverURL:8090/rest/api/latest/longtask/f9dd16c7-4a63-449e-af83-1897bfb4d8ed
Request type: GET
Content type: application/json; charset=utf-8
Response code: 200, message: null, url: http://MyserverURL:8090/rest/api/latest/longtask/f9dd16c7-4a63-449e-af83-1897bfb4d8ed

Waiting for task completion: 1% complete. Import failed. Check your server logs for more information. com.atlassian.confluence.importexport.ImportExportException: Unable to complete import: Error while importing backup: could not execute statement.
URL requested: http://MyserverURL:8090/rest/api/latest/longtask/f9dd16c7-4a63-449e-af83-1897bfb4d8ed
Request type: GET
Content type: application/json; charset=utf-8
Response code: 200, message: null, url: http://MyserverURL:8090/rest/api/latest/longtask/f9dd16c7-4a63-449e-af83-1897bfb4d8ed
.URL requested: http://MyserverURL:8090/rest/api/latest/longtask/f9dd16c7-4a63-449e-af83-1897bfb4d8ed
Request type: GET
Content type: application/json; charset=utf-8
Response code: 200, message: null, url: http://MyserverURL:8090/rest/api/latest/longtask/f9dd16c7-4a63-449e-af83-1897bfb4d8ed
.URL requested: http://MyserverURL:8090/rest/api/latest/longtask/f9dd16c7-4a63-449e-af83-1897bfb4d8ed
Request type: GET

- Content of http://MyserverURL:8090/rest/api/latest/longtask/f9dd16c7-4a63-449e-af83-1897bfb4d8ed :

{"id":"f9dd16c7-4a63-449e-af83-1897bfb4d8ed","name":{"key":"import.data.task.name","args":[]},"elapsedTime":5648,"percentageComplete":1,"successful":false,"messages":[{"translation":"Import failed. Check your server logs for more information. com.atlassian.confluence.importexport.ImportExportException: Unable to complete import: Error while importing backup: could not execute statement","args":[]}],"_links":{"base":"http://MyServerURL:8090","context":""}}

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events