Troubleshooting Project import failure in Jira
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
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
Summary
Importing a project from one Jira setup to another can be a complex task, and users may face several challenges along the way. For guidance on the project import process, please refer to Project Import.
If you're experiencing issues during or after a project import, this guide can help you troubleshoot and resolve them.
Here are few of the frequently observed scenarios listed:
- After importing projects, inconsistency is observed in ticket creation-date, update dates(history ) and sprint reports.
- While importing projects, errors like 'duplicate key violates unique constraints' are observed
- While importing project, observing 'Unexpected problem processing the backup XML'.
- Multiple errors like 'The custom field <custom-field-name> will not be imported because....'
- Observing users related issue while importing like 'There are n users that will be automatically created if import continues.'
- The provided attachment path does not contain a sub-directory called 'AA'. If you proceed with the import attachments will not be included.
- While migrating project from Jira cloud to Jira DC, noticed that old sprint data is not coming after project import.
- Import failure without any error message in UI. However in logs java.lang.NullPointerException is observed.
Environment
Jira Server / Data Center on any version from 8.0.0.
List of scenarios
Scenario 1 - After importing projects, inconsistency is observed in ticket creation-date, update dates (history) and sprint reports
Diagnosis
One must consider timezone difference between source and target Jira setup before performing project-import. Target Jira setup if not in same timezone as source may have inconsistency in ticket creation-date, update dates(history ) and sprint reports.
Resolution
To avoid this, user would have to set following jvm argument in target setup just before import. This is discussed in JRASERVER-66388. For more details check Set the timezone for the Java environment.
Scenario 2 - While importing projects, errors like 'duplicate key violates unique constraints' are observed
Diagnosis
- User may observe error like following in UI itself while importing project.
- This problem is well described in Duplicated entry - unique constraint violated with resolution.
Resolution
Follow below mentioned steps to resolve the problem mentioned in screenshot:
Shutdown your Jira application
Run the following query in the database:
update sequence_value_item set seq_id=(select max(id)+100 from customfieldvalue) where seq_name='CustomFieldValue';
Restart your Jira application
Scenario 3 - While importing projects, observing 'Unexpected problem processing the backup XML'
Diagnosis
In logs following errors are observed:
2023-05-16 02:04:21,553-0500 JiraTaskExecutionThread-34 ERROR user1 124x2383970x1 4l7rop IP1,IP2 /secure/admin/ProjectImportSelectProject.jspa [c.a.j.imports.xml.DefaultBackupXmlParser] Unexpected import failure java.lang.NullPointerException at com.atlassian.greenhopper.imports.LexorankPreImportHandler.addFieldMapping(LexorankPreImportHandler.java:87) at com.atlassian.greenhopper.imports.LexorankPreImportHandler.handleEntity(LexorankPreImportHandler.java:73) at com.atlassian.jira.imports.project.ao.handler.ChainedAoSaxHandler.endRow(ChainedAoSaxHandler.java:289) ------- 2023-05-16 02:04:21,553-0500 JiraTaskExecutionThread-34 ERROR user1 124x2383970x1 4l7rop IP1,IP2 /secure/admin/ProjectImportSelectProject.jspa [c.a.j.imports.project.DefaultProjectImportService] There was an unexpected problem processing the file '/opt/nfs/jira/import/intermediate_jira_backup_16_05_2023.zip' when performing a project import.
- This problem is well described in Project Import of Software project fails with Unexpected import failure
Resolution
This particular error was resolved with Resolution 2 from Project Import of Software project fails with Unexpected import failure as per following steps. Here user was not having any Advance RoadMap plans thus it was safe to delete records with negative entries for FIELD_ID.
Stop intermediate Jira setup
In intermediate setup first delete FIELD_ID less than 0. We are deleting records with negative entries for FIELD_ID as Advance Roadmap plans are not used thus there is no need of these invalid records.
SELECT * FROM "AO_60DB71_LEXORANK" WHERE "FIELD_ID" < 0; # If there are entries delete all of them. DELETE FROM "AO_60DB71_LEXORANK" WHERE "FIELD_ID" < 0;
Start Jira
Run a full Reindex (JIRA Administration > System > Indexing), any of the available options will work
Generate a new XML backup
Perform the Project Import in the target instance
Scenario 4 - Multiple errors like 'The custom field <custom-field-name> will not be imported because....'
Diagnosis/Resolution
- We may get errors like following or similar in UI while importing project.
Error Message 1: The custom field "issue color" will not be imported because the custom field type "com.pyxis.greenhopper.jira:jsw-issue-color" is not installed.
Solution: Remove custom field entry in the entities.xml file:
<CustomField id="10045" customfieldtypekey="com.pyxis.greenhopper.jira:jsw-issue-color" customfieldsearcherkey="com.pyxis.greenhopper.jira:jsw-issue-color-searcher" name="Issue color" description=""/>
Note: User would have to search for "Issue color". CustomField id may be different.
Error Message 2: The custom field "[CHART] Time in status" will not be imported because the custom field type "com.atlassian.jira.ext.charting:timeinstatus" is not installed.
This is related to Bug JRASERVER-31434
Solution: Remove custom field entry in the entities.xml file:
<CustomField id="10011" customfieldtypekey="com.atlassian.jira.ext.charting:timeinstatus" customfieldsearcherkey="com.atlassian.jira.ext.charting:textsearcher" name="[CHART] Time in Status" issuesWithValue="17369"/>
Note: User would have to search for "Time in Status". CustomField id may be different.
- There could be more errors related to custom fields like following.
- Custom Field "Epic Colour"
- Epic Color / Epic Colour is a default Jira Software Field
- Please check if the Custom Field "Epic Color" (without U) is found in the target instance. If so, user may wish to temporarily rename it to "Epic Colour" for the duration of the import.
- For more information, please see article Project import fails with field does not exist error in Jira server on how to resolve
- Custom Field "Start Date"
- Please ensure that this field is available for Epic issue types for the target project
- Check "Start Date" available to "Epic" via Field Configuration Schemes
- Check "Start Date" has a Global Context
Scenario 5 - Observing users related message while importing like 'There are n users that will be automatically created if import continues.'
As per doc Restoring a project from backup | Administering Jira applications Data Center and Server 9.10 | Atlassian Documentation , these users will be imported.
The Project Import will attempt to create missing users if they are associated with the project. However, if the Project Import tool cannot create missing mandatory users in your target Jira instance, then you will not be permitted to import the project. This may occur if you have External User Management enabled in your target Jira instance — you will need to disable External User Management or create the missing users manually in your external user repository before commencing the import.
Scenario 6 - The provided attachment path does not contain a sub-directory called 'AA'. If you proceed with the import attachments will not be included
Check if kb article The provided attachments path does not contain a sub-directory called" error during Project Import | Jira | Atlassian Documentation helps.
Scenario 7 - While migrating project from Jira cloud to Jira DC, noticed that old sprint data is not coming after project import
Diagnosis
- After Project import, notice that old sprint data is not coming after project import.
In logs, following errors are observed.
2023-05-25 10:35:42,315-0500 JiraTaskExecutionThread-101 ERROR someUser 634x4484656x1 13xwb9r IP1,IP2 /secure/admin/ProjectImportSummary.jspa [c.a.jira.task.TaskMana gerImpl] Task 'Importing project 'ProjectToImport'.' failed. java.lang.NullPointerException: Entity com.atlassian.greenhopper.service.sprint.SprintAO does not have field CREATED_DATE at java.base/java.util.Objects.requireNonNull(Objects.java:246) at net.java.ao.EntityManager.create(EntityManager.java:342) at net.java.ao.EntityManager.create(EntityManager.java:402) at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.create(EntityManagedActiveObjects.java:101) at com.atlassian.activeobjects.osgi.TenantAwareActiveObjects.create(TenantAwareActiveObjects.java:272) at jdk.internal.reflect.GeneratedMethodAccessor10454.invoke(Unknown Source) 2023-05-30 12:23:37,755-0500 JiraTaskExecutionThread-7 ERROR someUser 743x1094878x1 b0yg2z IP1,IP2 /secure/admin/ProjectImportSummary.jspa [c.a.j.imports.xml.DefaultBackupXmlParser] Unexpected import failure java.lang.NullPointerException: Entity com.atlassian.greenhopper.service.sprint.SprintAO does not have field SPRINT_VERSION at java.base/java.util.Objects.requireNonNull(Objects.java:246) at net.java.ao.EntityManager.create(EntityManager.java:342) at net.java.ao.EntityManager.create(EntityManager.java:402) at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.create(EntityManagedActiveObjects.java:101)
Resolution
- Product bug JRASERVER-73107 describes this problem.
- Fields CREATED_DATE and SPRINT_VERSION in are not available in table AO_60DB71_SPRINT of Jira DC thus it is safe to DROP these columns.
Remove the column from the step/intermediate instance's database directly and create a new XML backup for import in target Jira DC setup.
ALTER TABLE AO_60DB71_SPRINT DROP COLUMN CREATED_DATE; ALTER TABLE AO_60DB71_SPRINT DROP COLUMN SPRINT_VERSION;
Scenario 8 - Project import failure without any error message in UI. However in logs java.lang.NullPointerException is observed.
Diagnosis
- Project import fails without any message or notification in UI.
In logs, following errors are observed.
2023-08-16 14:32:27,497-0500 JiraTaskExecutionThread-107 ERROR user1 872x9158412x1 mfkgd9 IP1,IP2 /secure/a dmin/ProjectImportSelectProject.jspa [c.a.j.imports.xml.DefaultBackupXmlParser] Unexpected import failure java.lang.NullPointerException at com.atlassian.jira.imports.project.customfield.TextLengthValidatingCustomFieldImporter.canMapImportValue(TextLengthValidatingCustomFieldImporter.java:24) at com.atlassian.jira.imports.project.handler.CustomFieldValueValidatorHandler.validateCustomFieldValueWithField(CustomFieldValueValidatorHandler.java:98) at com.atlassian.jira.imports.project.handler.CustomFieldValueValidatorHandler.handleEntity(CustomFieldValueValidatorHandler.java:73)
Resolution
NPE happened because Jira tried to find any of the following entries in the
CustomFieldValue
section of the XML file but failed.- textvalue
- stringvalue
- numbervalue
We can completely delete entries similar to these where we don't see any of the textvalue, stringvalue or numbervalue entry in
entities.xml
of backup, then zip the activeobjects.xml and entities.xml together into the backup again. Try import again.<CustomFieldValue id="20" issue="15275" customfield="10706"/>
- For more details, check these KB article.
- Follow either Jira Project Import fails with "There was an unexpected problem processing the backup XML" | Jira | Atlassian Documentation
- Or Importing project data fails with Unexpected import failure due to CustomFieldValue with no value