Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCU-1020

Document issue with site-app when following a custom upgrade path

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Neutral Neutral
    • None
    • None
    • None
    • Yes
    • Docu Sprint 25
    • 8

      As mentioned by ahietala in the comment section of MGNLSITE-59, we need to document how to get rid of the inconsistent configuration one might end up with when following a custom upgrade path in an installation with STK, multisite and site-app (for further details see the description of the related ticket).
      The basic idea is to use a Groovy script which will do the required replacements and deletions. Not sure where exactly in the documentation all this could be mentioned. At any rate, here is the Groovy script to fix the borked config. One can simply execute it via GroovyApp in Magnolia.

      session = ctx.getJCRSession('config')
      updatedConfig = false
      
      def removeNode(absPath) {
        if (session.nodeExists(absPath)) {
            println "Removing config:$absPath ..."
            session.removeItem(absPath)
            updatedConfig = true
        }
      }
      
      if (session.nodeExists('/modules/multisite') && session.nodeExists('/modules/site-app') && session.nodeExists('/modules/standard-templating-kit')) {
          println "Detected multisite, site-app and stk modules. Let's see if configuration needs some clean up..."
      
          siteAppContentConnector = session.getNode('/modules/site-app/apps/site/subApps/browser/contentConnector')
      
          if ('/modules/site/config/site'.equals(PropertyUtil.getString(siteAppContentConnector, 'rootPath'))) {
              println 'Replacing config:/modules/site-app/apps/site/subApps/browser/contentConnector@rootPath value /modules/site/config/site with /modules/multisite/config/sites ...'
              PropertyUtil.setProperty(siteAppContentConnector, 'rootPath', '/modules/multisite/config/sites')
              updatedConfig = true
          }
          removeNode('/modules/ui-admincentral/apps/stkSiteApp')
          removeNode('/modules/ui-admincentral/config/appLauncherLayout/groups/stk/apps/stkSiteApp')
          removeNode('/modules/ui-admincentral/apps/stkThemesApp')
          removeNode('/modules/ui-admincentral/config/appLauncherLayout/groups/stk/apps/stkThemesApp')
          session.save()
      }
      
      if (updatedConfig) {
        return 'Configuration cleaned up. Bye.'
      } else {
        return 'Nothing to do here. Bye.'
      }
      

      As to a way to reproduce the inconsistent situation originally reported I did this

      • first step: install magnolia 5.4.3 EE (STK 2.9.2) w/o site-app
      • second step: upgrade to 5.4.4 (STK 2.9.3) still w/o site-app
      • third step:
        • add site-app 1.0.5
        • upgrade to site-module 1.0.5
        • upgrade to imaging-support 3.2.5 (needed by site-module 1.0.5)

        Acceptance criteria

              jlegendre Julie Legendre
              fgrilli Federico Grilli
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Task DoR