-
Bug
-
Resolution: Fixed
-
Low
-
None
-
Severity 1 - Critical
-
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
- Export a backup via Setttings -> System -> Backup manager -> Create backup for server
- Download and unzip the export file
- Inside the unzipped folder, examine activeobjects.xml
- 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:
- Unzip cloud backup
unzip cloudbackup.zip Archive: cloudbackup.zip inflating: entities.xml inflating: activeobjects.xml
- Expand xml to multiple lines:
xmllint activeobjects.xml --format > activeobjects_fixed.xml && mv activeobjects_fixed.xml activeobjects.xml
- Remove the foreign key entry.
- Zip backup back together.
zip -r cloudbackup_fixed.zip activeobjects.xml entities.xml
- Move the backup to the import directory on the destination instance and perform the import
- is related to
-
JRASERVER-69564 Restore from Cloud to Server fails with mismatched data type error on columns PROJECT.ID and AO_2C4E5C_MAILWHITELISTS.PROJECT_ID
-
- Closed
-
- was cloned as
-
MIG-1118 XML export from Cloud to Server fails to import
-
- Closed
-