[User-login] Restoring old Jira backup to 8.22.0 and newer
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Links
JRASERVER-70690 - User login fails because inconsistent data / uk_mem_parent_child_type
[User-login] Restoring Jira 8.22 (and newer) backup to Cloud
Restoring old Jira backup to 8.22.0 and newer
Old backups with corrupted Membership
rows cannot be restored to Jira 8.22 and future releases, because of the new uniqueness constraint.
There is a number of workarounds to remove corrupted rows:
Workaround 1a - grep
Find violating rows by running the following script:
1
grep '<Membership' $BACKUP_FILE | sed -E 's|.*<Membership .*(membershipType=[^ ]+).*( lowerParentName=[^ ]+).*( lowerChildName=[^ ]+).*( directoryId=[^ ]+).*/>|\1\2\3\4|' | sort | uniq -d
e.g.
1
$ grep '<Membership' $BACKUP_FILE | sed -E 's|.*<Membership .*(membershipType=[^ ]+).*( lowerParentName=[^ ]+).*( lowerChildName=[^ ]+).*( directoryId=[^ ]+).*/>|\1\2\3\4|' | sort | uniq -dmembershipType="GROUP_USER" lowerParentName="jira-project-admins" lowerChildName="proadmin" directoryId="1"
and remove the duplicates from the backup (leave only one entry!).
Workaround 1b - xsltproc
Find violating rows by running the following script:
1
xsltproc membership_uniq.xslt $BACKUP_FILE | sort | uniq -d
with the following XLS transformation in membership_uniq.xslt file:
1
2
3
4
5
6
7
8
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method='text'/>
<xsl:template match="/">
<xsl:for-each select="entity-engine-xml/Membership">lowerParentName="<xsl:value-of select="@lowerParentName"/>" lowerChildName=<xsl:value-of select="@lowerChildName"/>" membershipType="<xsl:value-of select="@membershipType"/>" directoryId="<xsl:value-of select="@directoryId"/>"
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
and remove the duplicates from the backup (leave one entry!).
Workaround 2
Import the backup into Jira < 8.22 and upgrade afterwards to Jira >= 8.22.
Workaround 3
Drop uk_mem_dir_parent_child
index and it will be recreated by the upgrade task.
Was this helpful?