Team Calendars Preflight Check for misaligned space keys between Parent and Sub Calendars

XMLWordPrintable

    • 35

      Problem Definition

      Misalignment on some calendars will cause failure during the space/calendar import to Cloud

      Suggested Solution

      Add preflight check for Team Calendars to handle the misalignment between the calendars.

      Why this is important

      To avoid error during the import

      Workaround

      • SQL query to identify the mismatched calendars, on Confluence on-prem:
        select sub."ID" as child_id,sub."NAME" as child_name,sub."SPACE_KEY" as child_space,parent."ID" as parent_id,parent."NAME" as parent_name,parent."SPACE_KEY" as parent_space
        from "AO_950DC3_TC_SUBCALS" sub
        join "AO_950DC3_TC_SUBCALS" parent on parent."ID"=sub."PARENT_ID"
        where sub."PARENT_ID" is not null and sub."SPACE_KEY" is not null and sub."SPACE_KEY" != parent."SPACE_KEY";
        
        • Sample output:

          Child Calendars from line 1 & 4 will not be migrated to Cloud as the Parent Calendar is not associated to any space
          Child Calendars from line 2 & 3 will cause ERROR: duplicate key value violates unique constraint "AO_950DC3_TC_SUBCALS_pkey" error during the import, because the Space Key isn't aligned with the Parent Calendar's.
      • SQL to fix the mismatched calendars, before the migration:
        • Line 1 & 4 scenario - Update "SPACE_KEY" of Parent Calendar, so the parent calendar is migrated with target space
          UPDATE "AO_950DC3_TC_SUBCALS" SET "SPACE_KEY"='ABC' WHERE "ID"='<id_of_parent_calendar>';
          
        • Line 2 & 3 scenario - Set the "SPACE_KEY" to null on the child calendar, so it is migrated with its parent calendar under the same space
          UPDATE "AO_950DC3_TC_SUBCALS" SET "SPACE_KEY"=null WHERE "ID"='<id_of_child_calendar>';
          

            Assignee:
            Unassigned
            Reporter:
            Ting
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: