[DOCU-1020] Document issue with site-app when following a custom upgrade path Created: 17/May/17  Updated: 03/Jul/17  Resolved: 26/May/17

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Neutral
Reporter: Federico Grilli Assignee: Julie Legendre
Resolution: Done Votes: 0
Labels: core
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
relation
is related to MGNLSITE-59 Site app should automatically configu... Closed
Template:
Acceptance criteria:
Empty
Task DoR:
Empty
Documentation update required:
Yes
Date of First Response:
Sprint: Docu Sprint 25
Story Points: 8

 Description   

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)


 Comments   
Comment by Julie Legendre [ 24/May/17 ]

Draft is here: https://documentation.magnolia-cms.com/display/DOCS54/Updating+a+custom+Magnolia+bundle

Comment by Julie Legendre [ 26/May/17 ]

Comments from federico integrated, cmeier would you like to review before I publish?

Generated at Mon Feb 12 01:14:26 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.