Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-33003

Confluence is not blocking the Upgrade if MS SQL has the wrong collation.

      If your Confluence is using the wrong collation in Microsoft SQL Server it shouldn't be possible to upgrade to version 5.2.3 or latest due the constraint check we added to block the upgrade, however those constraints are no longer working because the upgrade is no longer being blocked as it used to.

      Steps to reproduce:

      1. Set up a Confluence under version 5.2.3.
      2. Make sure to use the "SQL_Latin1_General_CP1_CI_AS" collation instead of "SQL_Latin1_General_CP1_CS_AS".
      3. Once this Confluence is up and running, upgrade it to version 5.2.3 or latest.
      4. The upgrade should fail due the constraint's we added around user mapping table, however it will work without problems.

      Diagnostic

      Run the below query against your Confluence MS SQL server database:

      SELECT object_name(object_id) as TableName, name as ColumnName, collation_name
      FROM sys.columns
      WHERE collation_name <> 'SQL_Latin1_General_CP1_CS_AS'
      AND object_name(object_id) NOT LIKE 'sys%' 
      AND object_name(object_id) NOT LIKE 'queue%'
      AND object_name(object_id) NOT LIKE 'file%'
      

      If the above return any results means your database is using the wrong collation.

      Work Around

      There are a few know methods we suggest our customers to use to address this:
      Always have a backup of your database before trying any of the below work around.
      Below methods will require some database knowledge in MsSQL Server, if possible engage your DBA in below activities.

      1. The resolution method provided in this KB which is not feasible to large instances since it relies on XML backup to create a clone instance.
      2. Install a fresh Confluence in the same version, making sure that this version is with the right collation as per our documentation. After that dummy instance is up do a few actions in this instance (like and watch a page to create a few AO tables) then use a data migration tool to migrate the data from the instance with the wrong collation to the dummy instance that should be using the correct collation.
      3. Follow this guide that teaches on how to manually fix the problem, which is a manual task and will be a very time consuming activity.
      4. Atlassian Experts, since they can provide a hands on assistance to address this (their services will be subject to a quote).
      5. The collation changer tool, which is a non supported tool that might result in data loss.
        We had good feedback from customers that tried the above tool, they didn't had nay data loss and the tool worked against SQL Server 2k5,2k8 and 2k12, even with those feedbacks this tool still should be used as a last resort, in case you decide for this option you will be using it at their own risk.

          Form Name

            [CONFSERVER-33003] Confluence is not blocking the Upgrade if MS SQL has the wrong collation.

            jaredocker added a comment -

            Ah, thanks for the clarification. An initial setup check would be great.

            jaredocker added a comment - Ah, thanks for the clarification. An initial setup check would be great.

            Actually that is how we are blocking the upgrade ocker. We have a feature request to have a proper check implemented on the initial setup that could deal with that problem gracefully on initial installations:

            https://jira.atlassian.com/browse/CONF-33769

            Thanks and Regards,
            David|Confluence Support Engineer

            Deividi Luvison (Inactive) added a comment - Actually that is how we are blocking the upgrade ocker . We have a feature request to have a proper check implemented on the initial setup that could deal with that problem gracefully on initial installations: https://jira.atlassian.com/browse/CONF-33769 Thanks and Regards, David|Confluence Support Engineer

            jaredocker added a comment -

            Just upgraded from Confluence 5.1.1 to 5.6.1 and ran into the same issue as well. Upgrade completed but when I started the service I got the database collation error.

            Windows 2008 R2 x64
            SQL Server 2012
            Confluence 5.6.1 x64

            jaredocker added a comment - Just upgraded from Confluence 5.1.1 to 5.6.1 and ran into the same issue as well. Upgrade completed but when I started the service I got the database collation error. Windows 2008 R2 x64 SQL Server 2012 Confluence 5.6.1 x64

            Ryan Pesta added a comment -

            Same thing happened to me. The installation was NOT blocked. Upgrading from 5.5.1 (Build 5501) to 5.5.3 and proceeded through the installation fine. Upon starting Confluence, I was presented with the Database Collation fatal error. I had to restore the backup files to regain access to Confluence. This needs to be reopened or a new ticket needs to be created.

            Using Windows 2008 R2 Standard x64. Confluence x64.

            Ryan Pesta added a comment - Same thing happened to me. The installation was NOT blocked. Upgrading from 5.5.1 (Build 5501) to 5.5.3 and proceeded through the installation fine. Upon starting Confluence, I was presented with the Database Collation fatal error. I had to restore the backup files to regain access to Confluence. This needs to be reopened or a new ticket needs to be created. Using Windows 2008 R2 Standard x64. Confluence x64.

            I'm using the Windows x64 installer if that matters. (on Win 2012 R2)

            Neal Culiner added a comment - I'm using the Windows x64 installer if that matters. (on Win 2012 R2)

            That is odd, I tested from 531 to 553 and the upgrade and I got blocked:

            Database collation is incorrect, it must be set to 'SQL_Latin1_General_CP1_CS_AS'. Please see https://confluence.atlassian.com/x/pQXFIw
            

            I will test your scenario and the other one I got to further validation.

            Thanks and Regards,
            David|Atlassian Support

            Deividi Luvison (Inactive) added a comment - That is odd, I tested from 531 to 553 and the upgrade and I got blocked: Database collation is incorrect, it must be set to 'SQL_Latin1_General_CP1_CS_AS' . Please see https: //confluence.atlassian.com/x/pQXFIw I will test your scenario and the other one I got to further validation. Thanks and Regards, David|Atlassian Support

            I always keep up to date, so 5.5.2 was what I upgraded from.

            Neal Culiner added a comment - I always keep up to date, so 5.5.2 was what I upgraded from.

            Yes Neal,

            I'm also validate that in our end so I can reopen the case accordingly.

            Thanks for your feedback.
            Also let me know from which version you upgraded neal3 so I can do a few more tests regarding the path.

            Thanks and Regards,
            David|Atlassian Support

            Deividi Luvison (Inactive) added a comment - - edited Yes Neal, I'm also validate that in our end so I can reopen the case accordingly. Thanks for your feedback. Also let me know from which version you upgraded neal3 so I can do a few more tests regarding the path. Thanks and Regards, David|Atlassian Support

            I suggest REOPEN this case, it is not resolved. I installed 5.5.3 and it did NOT block the installation. The installation proceeded then I could not access my site due to a fatal warning page that required me to fix the collation AFTER the upgrade. This took us down and thankfully we were able to correct the collation and bring the site back up.

            Neal Culiner added a comment - I suggest REOPEN this case, it is not resolved. I installed 5.5.3 and it did NOT block the installation. The installation proceeded then I could not access my site due to a fatal warning page that required me to fix the collation AFTER the upgrade. This took us down and thankfully we were able to correct the collation and bring the site back up.

            Hi Steve,

            I ran into this when installing 5.4.2. Please refer to https://support.atlassian.com/browse/CSP-119637 for details.

            Saul Perdomo added a comment - Hi Steve, I ran into this when installing 5.4.2. Please refer to https://support.atlassian.com/browse/CSP-119637 for details.

              merickson Matthew Erickson
              dluvison Deividi Luvison (Inactive)
              Affected customers:
              4 This affects my team
              Watchers:
              15 Start watching this issue

                Created:
                Updated:
                Resolved: