Importing from Jira Cloud to Server fails due to unknown entities

XMLWordPrintable

    • 1
    • Severity 2 - Major

      Summary

      When performing an import in Jira Server, the import will fail. The behaviour seen here is similar to JRACLOUD-63367; however there is an expanded list of tables.

      Environment

      Jira Server 8.0.2, Postgres 9.6

      Steps to Reproduce

      1. Generate backup from cloud instance
      2. Restore to JIRA Server 8.0.2

      Expected Results

      The import completes successfully

      Actual Results

      The import fails, and the following stack trace can be seen in atlassian-jira.log:

      2019-03-13 16:39:43,082 JiraImportTaskExecutionThread-1 INFO admin 999x257x1 12q1ai3 0:0:0:0:0:0:0:1 /secure/admin/XmlRestore.jspa [c.a.j.bc.dataimport.OfbizImportHandler] Failed to parse value for element FieldScope.
      java.lang.IllegalArgumentException: [GenericDelegator.makeValue] could not find entity for entityName: FieldScope
      	at org.ofbiz.core.entity.GenericDelegator.makeValue(GenericDelegator.java:497)
      	at com.atlassian.jira.ofbiz.DefaultOfBizDelegator.makeValue(DefaultOfBizDelegator.java:315)
      	at com.atlassian.jira.ofbiz.WrappingOfBizDelegator.makeValue(WrappingOfBizDelegator.java:182)
      	at com.atlassian.jira.bc.dataimport.OfbizImportHandler.parseValue(OfbizImportHandler.java:292)
      	at com.atlassian.jira.bc.dataimport.OfbizImportHandler.parseValueFailsafe(OfbizImportHandler.java:276)
      	at com.atlassian.jira.bc.dataimport.OfbizImportHandler.startElement(OfbizImportHandler.java:209)
      	at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
      	at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
      	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
      	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
      	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
      	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
      	at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
      	at com.atlassian.security.xml.RestrictedXMLReader.parse(RestrictedXMLReader.java:103)
      	at com.atlassian.jira.bc.dataimport.DefaultDataImportService.parseXmlAndValidateBackupData(DefaultDataImportService.java:390)
      	at com.atlassian.jira.bc.dataimport.DefaultDataImportService.doImport(DefaultDataImportService.java:290)
      	at com.atlassian.jira.web.action.setup.DataImportAsyncCommand.unsafeCall(DataImportAsyncCommand.java:82)
      	at com.atlassian.jira.web.action.setup.DataImportAsyncCommand.call(DataImportAsyncCommand.java:64)
      	at com.atlassian.jira.web.action.setup.DataImportAsyncCommand.call(DataImportAsyncCommand.java:30)
      	at com.atlassian.jira.task.ImportTaskManagerImpl$TaskCallableDecorator.call(ImportTaskManagerImpl.java:176)
      	at com.atlassian.jira.task.ImportTaskManagerImpl$TaskCallableDecorator.call(ImportTaskManagerImpl.java:148)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      

      This error can be observed for the following entities:

      • UpgradeTaskHistoryAuditLog
      • UpgradeTaskHistory
      • FieldScope
      • FixVersion
      • GlobalCustomFieldProjectAssociation
      • HierarchyLevel
      • IssueComponent
      • IssueList
      • IssueListEntry
      • IssueParentAssociation
      • IssueTypeFieldAssociation
      • IssueTypeHierarchyAssociation
      • ModuleStatus
      • ProjectConfiguration
      • Severity
      • UsernameHistory
      • AdHocUpgradeTaskHistory
      • AffectsVersion
      • AttachmentPanel
      • BaseHierarchyLevel

      Workaround

      1. Extract the backup - you'll have activeobjects.xml, entities.xml and data in the current folder
      2. Execute the following commands:
        egrep -v "(UpgradeTaskHistoryAuditLog|UpgradeTaskHistory|FieldScope|FixVersion|GlobalCustomFieldProjectAssociation|HierarchyLevel|IssueComponent|IssueList|IssueListEntry|IssueParentAssociation|IssueTypeFieldAssociation|IssueTypeHierarchyAssociation|ModuleStatus|ProjectConfiguration|Severity|UsernameHistory|AdHocUpgradeTaskHistory|AffectsVersion|AttachmentPanel|BaseHierarchyLevel)" entities.xml > entities-purged.xml
        
        mv entities-purged.xml entities.xml ; zip -r FixedBackup.zip entities.xml activeobjects.xml data
        

            Assignee:
            Unassigned
            Reporter:
            Dave Norton
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: