Changing database column type and length for Jira custom fields
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
Summary
When attempting to run a project import, if there are custom fields that are larger in the export than what the importing database allows, the column type and length in the database may need to be changed.
Environment
Jira 8.13.11 and later with an Oracle Database
Diagnosis
When attempting to perform the project import an error message similar to below is observed:
1
(<issue>: value too large for column "JIRAUSER"."FIELDLAYOUTITEM"."DESCRIPTION" (actual: 9622, maximum: 4000))
⚠️ Columns name, actual length and maximum may differ in your environment.
Cause
Varchar2 data type only takes 4000 characters, but the import the field contains more than 4000 characters.
Solution
To address this we will need to change the data type to allow additional characters. To perform this:
Stop Jira
Go to <install-directory>/atlassian-jira/WEB-INF/classes/entitydefs/entitymodel.xml and find the appropriate
entity-name
. From the example above,FieldLayoutItem
was the custom field that needed its description field changed.1 2 3 4 5 6
<entity entity-name="FieldLayoutItem" table-name="fieldlayoutitem" package-name=""> <field name="id" type="numeric"/> <field name="fieldlayout" type="numeric"/> <field name="fieldidentifier" type="long-varchar"/> <field name="description" type="very-long"/>
Change the "type" for the "description" field to the new value. In this case,
very-long
toextremely-long
as below.1 2 3 4 5 6
<entity entity-name="FieldLayoutItem" table-name="fieldlayoutitem" package-name=""> <field name="id" type="numeric"/> <field name="fieldlayout" type="numeric"/> <field name="fieldidentifier" type="long-varchar"/> <field name="description" type="extremely-long"/>
Restart Jira.
Attempt the import again.
Was this helpful?