XML import fail due to java.sql.BatchUpdateException while migrating from Oracle to PostgreSQL

XMLWordPrintable

    • Type: Bug
    • Resolution: Won't Fix
    • Priority: High
    • None
    • Affects Version/s: 6.3.5
    • Component/s: None
    • None
    • 6.03
    • 5
    • Severity 1 - Critical
    • 1
    • Hide
      Atlassian Update – 31 Oct 2018

      Hi everyone,

      We have recently reviewed this issue and the overall interest in the problem. As the issue hasn't collect votes, watchers, comments, or support cases from many customers during its lifetime, and has a viable workaround, it's very low on our priority list, and will not be fixed in the foreseeable future. 

      That's why we've decided to resolve it as Won't fix.

      Although we're aware the issue is still important to those of you who were involved in the conversations around it, we want to be clear in managing your expectations. The Jira team is focusing on issues that have broad impact and high value, reflected by the number of comments, votes, support cases, and customers interested. Please consult the Atlassian Bugfix Policy for more details.

      We understand how disappointing this decision may be, but we hope you'll appreciate our transparent approach and communication.
      Atlassian will continue to watch this issue for further updates, so please feel free to share your thoughts in the comments.

      Thank you,
      Ignat Alexeyenko
      Jira Bugmaster

      Show
      Atlassian Update – 31 Oct 2018 Hi everyone, We have recently reviewed this issue and the overall interest in the problem. As the issue hasn't collect votes, watchers, comments, or support cases from many customers during its lifetime, and has a viable workaround, it's very low on our priority list, and will not be fixed in the foreseeable future.  That's why we've decided to resolve it as Won't fix. Although we're aware the issue is still important to those of you who were involved in the conversations around it, we want to be clear in managing your expectations. The Jira team is focusing on issues that have broad impact and high value, reflected by the number of comments, votes, support cases, and customers interested. Please consult the Atlassian Bugfix Policy for more details. We understand how disappointing this decision may be, but we hope you'll appreciate our transparent approach and communication. Atlassian will continue to watch this issue for further updates, so please feel free to share your thoughts in the comments. Thank you, Ignat Alexeyenko Jira Bugmaster

      Description:

      With the implementation of future sprints we have changed the relationship between sprints and issues and because of this all boards need to be migrated before it can be used.

      The Problem:

      This migration is done one board at a time and the column SPRINT_MARKERS_MIGRATED was included into the table AO_60DB71_RAPIDVIEW in order to mark whether the board was already migrated or still need to be.

      In Oracle the column SPRINT_MARKERS_MIGRATED is defined as number null(able), but in PostgreSQL it is defined as boolean, which by definition will not accept null.

      This can cause problems when migrating from Oracle to PostgreSQL, the XML import fails with the following message:

      2013-11-11 18:20:22,676 JiraImportTaskExecutionThread-1 ERROR anonymous 1076x23x1 1k40ips 0:0:0:0:0:0:0:1%0 /secure/SetupImport.jspa [jira.bc.dataimport.DefaultDataImportService] Error during ActiveObjects restore
      com.atlassian.activeobjects.spi.ActiveObjectsImportExportException: There was an error during import/export with plugin JIRA Agile(com.pyxis.greenhopper.jira) #6.3.2.1 (table AO_60DB71_RAPIDVIEW):
      ...
      Caused by: java.sql.BatchUpdateException: Batch entry 0 INSERT INTO public."AO_60DB71_RAPIDVIEW" ("ID", "NAME", "OWNER_USER_NAME", "SAVED_FILTER_ID", "SPRINTS_ENABLED", "SWIMLANE_STRATEGY", "CARD_COLOR_STRATEGY", "SPRINT_MARKERS_MIGRATED") VALUES ('102', 'Test Board', 'admin', '19585', '0', 'custom', 'issuetype', NULL) was aborted.  Call getNextException to see the cause.
      

      Workaround:

      Option 1:
      1. Create a database backup;
      2. Convert null entries into 0 with the following query:
        update AO_60DB71_RAPIDVIEW set SPRINT_MARKERS_MIGRATED = 0 where SPRINT_MARKERS_MIGRATED is null;
        
      3. Make sure that there isn't any null entry with the following query:
        select * from AO_60DB71_RAPIDVIEW where SPRINT_MARKERS_MIGRATED is null;
        
      4. Create a new XML backup and import it again into PostgreSQL;
      Option 2:

      Alternatively to the above option, it's also possible to modify the activeobjects.xml using the search and replace functionality of a text editor changing the nulls by 0's.

      From:

      <integer xsi:nil="true"/>
      

      To:

      <integer>0</integer>
      

      The following will "Search and Replace" <integer xsi:nil="true"/> with <integer>0</integer> in the activeobjects.xml file in Vim, :

      :%s/<integer xsi:nil="true"\/>/<integer>0<\/integer>/g
      

      Proposed fix:

      Either do not allow null entries into the SPRINT_MARKERS_MIGRATED column, or add a task to convert null into 0 when importing an XML backup.

            Assignee:
            Unassigned
            Reporter:
            Tiago Comasseto
            Votes:
            3 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: