Uploaded image for project: 'Jira Cloud'
  1. Jira Cloud
  2. JRACLOUD-72563

Export to server produces file that fails to import.

    XMLWordPrintable

Details

    Description

      Issue Summary

      When exporting to server, the downloaded file contains a foreignKey reference to the table project, column id. However, the table and column name are in uppercase:

      <foreignKey fromTable="AO_2C4E5C_MAILWHITELISTS" fromColumn="PROJECT_ID" toTable="PROJECT" toColumn="ID" />
      

      This leads to errors when importing on server. (e.g. https://jira.atlassian.com/browse/JRASERVER-69564)

      However, the entire table is not needed on server; it is only used on cloud.

       

      Steps to Reproduce

      1. Export a backup via Setttings -> System -> Backup manager -> Create backup for server
      2. Download and unzip the export file
      3. Inside the unzipped folder, examine activeobjects.xml
      4. It contains a reference to the table AO_2C4E5C_MAILWHITELISTS including the foreignKey causing issues during import.

      Expected Results

      The table AO_2C4E5C_MAILWHITELISTS should not be exported to server.

      Actual Results

      The below tags are exported as part of the activeobjects.xml file:

      <table name="AO_2C4E5C_MAILWHITELISTS">
        <column name="CREATED_TIMESTAMP" primaryKey="false" autoIncrement="false" sqlType="-5" precision="19" />
        <column name="CREATED_USER_ID" primaryKey="false" autoIncrement="false" sqlType="12" precision="255" />
        <column name="DOMAIN" primaryKey="false" autoIncrement="false" sqlType="12" precision="255" />
        <column name="ID" primaryKey="true" autoIncrement="true" sqlType="4" precision="10" />
        <column name="PROJECT_ID" primaryKey="false" autoIncrement="false" sqlType="-5" precision="19" />
        <column name="UPDATED_TIMESTAMP" primaryKey="false" autoIncrement="false" sqlType="-5" precision="19" />
        <column name="UPDATED_USER_ID" primaryKey="false" autoIncrement="false" sqlType="12" precision="255" />
        <foreignKey fromTable="AO_2C4E5C_MAILWHITELISTS" fromColumn="PROJECT_ID" toTable="PROJECT" toColumn="ID" />
      </table>
      

      Workaround

      The problematic line has to be removed from activeobjects.xml file:

          <foreignKey fromTable="AO_2C4E5C_MAILWHITELISTS" fromColumn="PROJECT_ID" toTable="PROJECT" toColumn="ID"/>
      

      The following steps can be used to perform and validate this change:

      1. Unzip cloud backup
      unzip cloudbackup.zip 
      Archive: cloudbackup.zip
       inflating: entities.xml
       inflating: activeobjects.xml
      1. Expand xml to multiple lines:
      xmllint activeobjects.xml --format > activeobjects_fixed.xml && mv activeobjects_fixed.xml 
      activeobjects.xml 
      1. Remove the foreign key entry.
      2. Zip backup back together.
      zip -r cloudbackup_fixed.zip activeobjects.xml entities.xml
      1. Move the backup to the import directory on the destination instance and perform the import

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              bvotteler@atlassian.com Brendon Votteler (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: