Hi,
I don't have permission to create a ticket in the Jira bug reporter, so I'll post it here:
Summary: JIRA backup to XML creates <table> entries out of order, which causes import to fail
Component: Backup & Restore: Import from JIRA Server
Affected version: 7.13.0
Description:
I exported my JIRA 7.13.0 instance to an XML backup. When I tried to import it the import failed with an exception that the MySQL Jira user did not have the REFERENCES privilege. This is a red herring.
Unzipping the backup file and looking at activeobjects.xml shows a <table> entry that contains this data:
<table name="AO_563AEE_ACTIVITY_ENTITY">
...
<foreignKey fromTable="AO_563AEE_ACTIVITY_ENTITY" fromColumn="ACTOR_ID" toTable="AO_563AEE_ACTOR_ENTITY" toColumn="ID"/>
<foreignKey fromTable="AO_563AEE_ACTIVITY_ENTITY" fromColumn="ICON_ID" toTable="AO_563AEE_MEDIA_LINK_ENTITY" toColumn="ID"/>
<foreignKey fromTable="AO_563AEE_ACTIVITY_ENTITY" fromColumn="OBJECT_ID" toTable="AO_563AEE_OBJECT_ENTITY" toColumn="ID"/>
<foreignKey fromTable="AO_563AEE_ACTIVITY_ENTITY" fromColumn="TARGET_ID" toTable="AO_563AEE_TARGET_ENTITY" toColumn="ID"/>
</table>
In the xml file however, the <table> (creation) entries for AO_563AEE_ACTOR_ENTITY, AO_563AEE_MEDIA_LINK_ENTITY, etc. follow the entry to create the AO_563AEE_ACTIVITY_ENTITY table, so the foreign key reference to these non-existent tables fails.
I fixed this in my xml file by moving the AO_563AEE_ACTIVITY_ENTITY <table> element to after the <table> entries for the four references tables. Then the import works fine.
So the fix in the backup generation code is to make sure any referenced foreign table elements appear before the creation of the table(s) that reference them.
I think you should report this via https://support.atlassian.com/contact/#/ so that support team can move it to developers.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.