-
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
-
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:
Create a database backup;- Convert null entries into 0 with the following query:
update AO_60DB71_RAPIDVIEW set SPRINT_MARKERS_MIGRATED = 0 where SPRINT_MARKERS_MIGRATED is null;
- Make sure that there isn't any null entry with the following query:
select * from AO_60DB71_RAPIDVIEW where SPRINT_MARKERS_MIGRATED is null;
- 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.