Upgrading from 2.3 to 2.4 - tsgrp/hpi GitHub Wiki

HPI Config Updates

When migrating an existing HPI application from 2.3 to 2.4, it is recommended to backup your existing /hpi/configs folder, and then reconfigure HPI. A number of significant changes to the back end structure of configs that make updating config JSON files in place a difficult proposition. The following strategy is recommended:

  1. Install HPI 2.4 in a QA or Test environment
  2. Configure HPI based on your existing production environment
  3. Upgrade the production environment to HPI 2.4
  4. Port the configurations from QA/Test to Production.

Notes:

  • Dashlets now require a unique ID, specified in the dashlet admin. Please be sure that all dashlets have a unique ID. This ensures that the reorder dashlets feature added in 2.4 works properly.
  • In many attribute selectors, the HPI admin now shows the attribute label vs. the OC name.
  • Search sections have been renamed:
    • Advanced Search is now 'Attribute Search'
    • A new Advanced Search allows administrators to configure an advanced attribute search screen that allows additional functionality

HPI Model Updates

In HPI 2.4, the note attachment attribute for the HPI Note type was changed from single to repeating. This must be taken into account when upgrading a system that uses HPI folder or document notes to HPI 2.4+. Making the attribute repeating allows us now to attach a Document Note to more than one document.

Wizard Alfresco Updates

Between 2.3 and 2.4, the "Controlled Document" object type became the "Quality Document" object type.

Upgrade Content Model

  • To update without old content, update OC and HPI, and clear cached items in your deployed tomcat.
  • Clear your cached Alfresco Solr-generated Model data in alf_data.
  • Deploy new code.
  • Using Alfresco Share, update your configs by grabbing the latest from edge2.tsgrp.com/share.
  • Unlock all existing locked Controlled Documents.
  • If you don't care to maintain existing content, delete all Controlled Document content from Share, otherwise continue with the next section.

Maintain existing content

  • To maintain existing content, first you will need to modify a property in alfresco-defaults.properties. Set the following property:

alfresco.controlledDocuments.upgradeFromControlledToQuality=true

  • Redeploy updated code. Verify in the tomcat's alfresco-defaults.properties that this property is set to true (If it is not, the script will corrupt all of your controlled doc content).
  • Once verified, start Alfresco and navigate to the javascript console in share.
  • If any are found that are checked out, please check-in before moving forward.
  • Next, run the following script:
     var nodes = search.luceneSearch('TYPE:aw\\:controlledDocument AND NOT TYPE:aw\\:qualityDocument');
 
     for each(var node in nodes) {
        logger.log(node.name + ' (' + node.typeShort + '): ' + node.nodeRef);
           	node.specializeType('aw:qualityDocument');
           	if(node.hasAspect('tsg:draft')){
                          	node.removeAspect('tsg:draft');
                          	node.addAspect('tsg:qualityDraft');
           	}
           	if(node.hasAspect('tsg:pendingApproval')){
                          	node.removeAspect('tsg:pendingApproval');
                          	node.addAspect('tsg:qualityPendingApproval');
           	}
           	if(node.hasAspect('tsg:inReview')){
                          	node.removeAspect('tsg:inReview');
                          	node.addAspect('tsg:qualityInReview');
           	}
           	if(node.hasAspect('tsg:approved')){
                          	node.removeAspect('tsg:approved');
                          	node.addAspect('tsg:qualityApproved');
           	}
           	if(node.hasAspect('tsg:effective')){
                          	node.removeAspect('tsg:effective');
                          	node.addAspect('tsg:qualityEffective');
           	}
           	if(node.hasAspect('tsg:superseded')){
                          	node.removeAspect('tsg:superseded');
                          	node.addAspect('tsg:qualitySuperseded');
           	}
           	if(node.hasAspect('tsg:obsolete')){
                          	node.removeAspect('tsg:obsolete');
                          	node.addAspect('tsg:qualityObsolete');
           	    }
           	
     }

  • Once finished with the script, make sure to change the property back to false: alfresco.controlledDocuments.upgradeFromControlledToQuality=false

  • After this is done, redeploy the updated code.