Space import fails with "No enum constant com.atlassian.confluence.spaces.SpaceStatus"

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

When importing a space XML backup into Confluence, the import fails with an error on screen like so:

The following appears in the atlassian-confluence.log:

2014-05-29 11:17:34,695 ERROR [Long running task: Importing data] [confluence.importexport.xmlimport.BackupImporter] importEntities Cannot import the entities: 
 -- url: /admin/restore.action | userName: admin | referer: http://confluence.example.com:8090/admin/backup.action | action: restore
com.atlassian.confluence.importexport.ImportExportException: Unable to complete import: Error while importing backup: No enum constant com.atlassian.confluence.spaces.SpaceStatus.
	at com.atlassian.confluence.importexport.xmlimport.DefaultXmlImporter.doImport(DefaultXmlImporter.java:76)
	at com.atlassian.confluence.importexport.xmlimport.BackupImporter.importEntities(BackupImporter.java:404)
	at com.atlassian.confluence.importexport.xmlimport.BackupImporter.importEverything(BackupImporter.java:372)
	at com.atlassian.confluence.importexport.xmlimport.FileBackupImporter.importEverything(FileBackupImporter.java:138)
	at com.atlassian.confluence.importexport.xmlimport.BackupImporter$1.doInTransactionWithoutResult(BackupImporter.java:210)
...

Cause

SpaceStatus is a property in the backup file that requires one of two values, "CURRENT" or "ARCHIVED". The error is thrown if neither exist.

Workaround

  1. Unzip your XML .zip backup file
  2. Locate and edit entities.xml
  3. Find the following property:

    <property name="spaceStatus" enum-class="SpaceStatus" package="com.atlassian.confluence.spaces"/>
  4. Replace it with the following:

    <property name="spaceStatus" enum-class="SpaceStatus" package="com.atlassian.confluence.spaces">CURRENT</property>

    If you want the space to be marked as Archived, used "ARCHIVED" instead of "CURRENT" for the property value.

  5. Zip up all the files again.

    Important: Ensure that the files you're zipping up are at the root of the archive, and not nested under a subdirectory. In other words, do not put all the backup files under a directory and simply zip up the directory. Doing this will cause the the restore to fail when you attempt to import the space into Confluence.

Last modified on Mar 30, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.