Confluence 6.2 Unable to complete import (cloud to server)
Asked by Assia Abderrahim:

Hi,  
I tried to migrate confluence from the cloud to the servers  
I did a backup with no attachments and when I start restoring the data it crashes after a few minutes (the database is on SQL Server 2014 SP2, confluence is installed on linux)

![import error.PNG](/t5/image/serverpage/image-id/1670i6F4569DAA5C903E2/image-dimensions/515x244?v=v2 "import error.PNG")  
Here is the error that I have in the log

2017-05-29 15:22:30,519 ERROR \[Long running task: Importing data\] \[confluence.importexport.xmlimport.BackupImporter\] importEntities Cannot import the entities:  
-- url: /longrunningtaskxml.action \| referer: http://localhost:8090/admin/restore-local-file.action \| traceId: f3fa46027d449cf0 \| userName: admin \| action: longrunningtaskxml  
com.atlassian.confluence.importexport.ImportExportException: Unable to complete import: Error while importing backup: not-null property references a null or transient value : com.atlassian.confluence.setup.bandana.ConfluenceBandanaRecord.key  
at com.atlassian.confluence.importexport.xmlimport.DefaultXmlImporter.doImport(DefaultXmlImporter.java:64)

.....

Caused by: org.xml.sax.SAXException: Error while importing backup: not-null property references a null or transient value : com.atlassian.confluence.setup.bandana.ConfluenceBandanaRecord.key  
net.sf.hibernate.PropertyValueException: not-null property references a null or transient value : com.atlassian.confluence.setup.bandana.ConfluenceBandanaRecord.key  
at com.atlassian.confluence.importexport.xmlimport.parser.BackupParser.endElement(BackupParser.java:45)  
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)  
at o


Answers:
author: Jeff Turner
body: I hit the same problem, and Atlassian Support fixed the Confluence Cloud database. However I also managed to fix it by editing the XML thusly:

```
unzip -p Site_Backup.zip entities.xml > entities.xml.orig
xmlstarlet sel --noblanks -t -v "//object[@class='ConfluenceBandanaRecord' and property[@name='key'] = '']" -n < entities.xml.orig   # Find the blank node. Yours may not be 'DefaultLoginManager' assumed below.
xmlstarlet ed --delete "//object[@class='ConfluenceBandanaRecord' and property[@name='key'] = '' and property[@name='context'] = 'com.atlassian.confluence.security.login.DefaultLoginManager']" entities.xml.orig > entities.xml
zip -u Site_Backup.zip entities.xml
```


author: AnnWorley
body: It looks like the error is similar to the one described in [XML import fails due to error: not-null property references a null or transient value](https://confluence.atlassian.com/confkb/xml-import-fails-due-to-error-not-null-property-references-a-null-or-transient-value-666601423.html)

From the log snippet, you have an issue with the **bandana** table rather than the **links** table. The knowledge base article recommends running some queries on the source database, which is Cloud in your case. The Atlassian Cloud support team can run the queries for you as you won't have access. Please open a ticket at <https://getsupport.atlassian.com>.

comments: author: Assia Abderrahim
body: Thank you I opened a ticket on the support