Database Migration to Oracle Fails with "value too large for column" Error on CRU_REVIEW
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
Problem
When trying to migrate from the embedded HSQLDB to Oracle, it fails with a similar on-screen error:
1
2
3
4
5
6
7
8
9
Database error at cru_review:4575 (table:row) of the input: ORA-12899:
value too large for column "<Fisheye Database>"."CRU_REVIEW"."CRU_NAME" (actual:
261, maximum: 255)
null
Database migration failed: com.atlassian.crucible.migration.ParseException: null
ORA-12899: value too large for column "<Fisheye Database>"."CRU_REVIEW"."CRU_NAME" (actual: 261, maximum: 255)
Database migration failed: java.sql.BatchUpdateException: ORA-12899:
value too large for column "FISHEYE"."CRU_REVIEW"."CRU_NAME" (actual:
261, maximum: 255)
Cause
The embedded HSQLDB does not enforce any column length, which can cause a problem when migrating to an external database with such constraints in place. In this case, the CRU_NAME column in the CRU_REVIEW table has exceeded the limit of 255 characters. It has 261 characters in one of the records.
Resolution
Ensure you have a complete backup of your Fisheye isntance prior to running the following query directly on your database.
Create a file called fixupdb.sql
with the following content:
1
update cru_review set cru_name = left(cru_name, 255) where length(cru_name) > 255 ;
This will truncate all such reviews with column length larger than 255.
To apply the patch, follow these steps:
Backup Fisheye
Shut down Fisheye
Run the fixupdb.sql on the internal database by using the following command:
1
java -Xms1024m -Xmx1024m -jar <FishEye installation directory>/lib/hsqldb-1.8.0.10.jar --inlineRC "URL=jdbc:hsqldb:file:<FISHEYE_HOME>/var/data/crudb/crucible;shutdown=true,USER=sa,PASSWORD=" <path_to_file>/fixupdb.sql
After that, if the script succeeds, you should be able to start Fisheye again and retrigger the migration.
Was this helpful?