Uploaded image for project: 'Jira Software Data Center'
  1. Jira Software Data Center
  2. JSWSERVER-16049

There is no upgrade task to change columns from VARCHAR to NVARCHAR when using SQL Server

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Low Low
    • None
    • 7.2.10, 7.3.8, 7.4.3, 7.5.0-EAP01
    • Board configuration

      Summary

      When upgrading JIRA to 7.2+ the database columns with data type VARCHAR will not be changed to NVARCHAR. This might trigger JSWSERVER-15917.

      Environment

      • JIRA 6.4 upgraded to 7.2+
      • Microsoft SQL Server 2012 or 2014.
      • 1M+ issues.

      Steps to Reproduce

      1. Upgrade a JIRA instance from 6.4 to 7.2 or higher.

      Expected Results

      Columns data types are changed from VARCHAR to NVARCHAR.

      Actual Results

      Columns remain at VARCHAR.

      Notes

      Causes JSWSERVER-15917.

      Workaround

      Example of workaround for AO_60DB71_LEXORANK table. Similar approach can be done for other tables.

      1. Stop JIRA.
      2. Backup your database.
      3. Delete all indexes from the table AO_60DB71_LEXORANK, except for the primary key.
      4. Change the data type on the columns AO_60DB71_LEXORANK.RANK and AO_60DB71_LEXORANK.LOCK_HASH using these SQL queries:
        ALTER TABLE dbo.AO_60DB71_LEXORANK ALTER COLUMN RANK NVARCHAR(255) NOT NULL;
        ALTER TABLE dbo.AO_60DB71_LEXORANK ALTER COLUMN LOCK_HASH NVARCHAR(255) NULL;
        
      5. Run the following SQL queries to flush caches and update statistics on the database:
        DBCC FREEPROCCACHE;
        SP_UPDATESTATS;
        
      6. Start JIRA. The indexes for the table AO_60DB71_LEXORANK will be automatically recreated.

      This duplicates JRASERVER-59816

            Unassigned Unassigned
            vfontes Vinicius Fontes
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: