
Minor upgrading is a common task in Alfresco. In many cases, upgrading just only WAR artifacts should enough to complete the process. However, what about the patches applied in other resources like configuration files?
Following a customized process to upgrade from 5.1.e (201602) to 5.1.f (201604) is described. This process can be take as an example for any other minor upgrading between different Alfresco versions.
Comparing distributions
$ diff --brief -r alfresco-community-distribution-201602 alfresco-community-distribution-201604 Files alfresco-community-distribution-201602/README.txt and alfresco-community-distribution-201604/README.txt differ Files alfresco-community-distribution-201602/amps/alfresco-share-services.amp and alfresco-community-distribution-201604/amps/alfresco-share-services.amp differ Files alfresco-community-distribution-201602/bin/alfresco-mmt.jar and alfresco-community-distribution-201604/bin/alfresco-mmt.jar differ Files alfresco-community-distribution-201602/solr4/archive-SpacesStore/conf/schema.xml and alfresco-community-distribution-201604/solr4/archive-SpacesStore/conf/schema.xml differ Files alfresco-community-distribution-201602/solr4/archive-SpacesStore/conf/solrcore.properties and alfresco-community-distribution-201604/solr4/archive-SpacesStore/conf/solrcore.properties differ Files alfresco-community-distribution-201602/solr4/templates/rerank/conf/solrcore.properties and alfresco-community-distribution-201604/solr4/templates/rerank/conf/solrcore.properties differ Files alfresco-community-distribution-201602/solr4/templates/test/conf/solrcore.properties and alfresco-community-distribution-201604/solr4/templates/test/conf/solrcore.properties differ Files alfresco-community-distribution-201602/solr4/templates/vanilla/conf/solrcore.properties and alfresco-community-distribution-201604/solr4/templates/vanilla/conf/solrcore.properties differ Files alfresco-community-distribution-201602/solr4/templates/without_suggest/conf/solrcore.properties and alfresco-community-distribution-201604/solr4/templates/without_suggest/conf/solrcore.properties differ Files alfresco-community-distribution-201602/solr4/workspace-SpacesStore/conf/solrcore.properties and alfresco-community-distribution-201604/solr4/workspace-SpacesStore/conf/solrcore.properties differ Files alfresco-community-distribution-201602/web-server/shared/classes/alfresco/web-extension/share-config-custom.xml and alfresco-community-distribution-201604/web-server/shared/classes/alfresco/web-extension/share-config-custom.xml differ Files alfresco-community-distribution-201602/web-server/webapps/ROOT.war and alfresco-community-distribution-201604/web-server/webapps/ROOT.war differ Files alfresco-community-distribution-201602/web-server/webapps/alfresco.war and alfresco-community-distribution-201604/web-server/webapps/alfresco.war differ Files alfresco-community-distribution-201602/web-server/webapps/share.war and alfresco-community-distribution-201604/web-server/webapps/share.war differ Files alfresco-community-distribution-201602/web-server/webapps/solr4.war and alfresco-community-distribution-201604/web-server/webapps/solr4.war differ
We can see that, in addition to WAR artifacts (alfresco, share, ROOT and solr4), some other components have changed. Binary components (alfresco-share-services.amp
and alfresco-mmt.jar
) can be overwrited, but let’s examine other changes in order to decide how they apply to our Alfresco installation.
Examining text files
solr4/archive-SpacesStore/conf/schema.xml
Action: overwrite.
$ diff -c alfresco-community-distribution-201602/solr4/archive-SpacesStore/conf/schema.xml alfresco-community-distribution-201604/solr4/archive-SpacesStore/conf/schema.xml *** alfresco-community-distribution-201602/solr4/archive-SpacesStore/conf/schema.xml 2016-02-16 16:25:32.000000000 +0100 --- alfresco-community-distribution-201604/solr4/archive-SpacesStore/conf/schema.xml 2016-04-22 20:32:28.000000000 +0200 *************** *** 731,736 **** --- 731,741 ---- <dynamicField name="content@m___t@*" type="text___" indexed="true" omitNorms="false" stored="false" multiValued="true" /> + <!-- Suggestion --> + <dynamicField name="suggest_*" type="text_shingle" indexed="false" omitNorms="true" stored="false" multiValued="true" /> + + <copyField source="suggest_*" dest="suggest" /> + </fields> <uniqueKey>id</uniqueKey>
solr4/archive-SpacesStore/conf/solrcore.properties
Action: Modify alfresco.recordUnindexedNodes
property in my installation, as I’ve modified this resource previously.
$ diff -c alfresco-community-distribution-201602/solr4/archive-SpacesStore/conf/solrcore.properties alfresco-community-distribution-201604/solr4/archive-SpacesStore/conf/solrcore.properties *** alfresco-community-distribution-201602/solr4/archive-SpacesStore/conf/solrcore.properties 2016-02-16 16:25:46.000000000 +0100 --- alfresco-community-distribution-201604/solr4/archive-SpacesStore/conf/solrcore.properties 2016-04-22 20:32:40.000000000 +0200 *************** *** 10,16 **** # # Alfresco version # ! alfresco.version=5.1.0 (r@scm-revision@-b@build-number@) # --- 10,16 ---- # # Alfresco version # ! alfresco.version=5.2.0 (r@scm-revision@-b@build-number@) # *************** *** 31,37 **** # It will reduce the hole checking load alfresco.hole.check.after=300000 alfresco.batch.count=1000 ! alfresco.recordUnindexedNodes=false # encryption --- 31,37 ---- # It will reduce the hole checking load alfresco.hole.check.after=300000 alfresco.batch.count=1000 ! alfresco.recordUnindexedNodes=true # encryption
solr4/workspace-SpacesStore/conf/solrcore.properties
Action: Modify alfresco.recordUnindexedNodes
property in my installation, as I’ve modified this resource previously.
$ diff -c alfresco-community-distribution-201602/solr4/workspace-SpacesStore/conf/solrcore.properties alfresco-community-distribution-201604/solr4/workspace-SpacesStore/conf/solrcore.properties *** alfresco-community-distribution-201602/solr4/workspace-SpacesStore/conf/solrcore.properties 2016-02-16 16:25:46.000000000 +0100 --- alfresco-community-distribution-201604/solr4/workspace-SpacesStore/conf/solrcore.properties 2016-04-22 20:32:40.000000000 +0200 *************** *** 10,16 **** # # Alfresco version # ! alfresco.version=5.1.0 (r@scm-revision@-b@build-number@) # --- 10,16 ---- # # Alfresco version # ! alfresco.version=5.2.0 (r@scm-revision@-b@build-number@) # *************** *** 31,37 **** # It will reduce the hole checking load alfresco.hole.check.after=300000 alfresco.batch.count=1000 ! alfresco.recordUnindexedNodes=false # encryption --- 31,37 ---- # It will reduce the hole checking load alfresco.hole.check.after=300000 alfresco.batch.count=1000 ! alfresco.recordUnindexedNodes=true # encryption
web-server/shared/classes/alfresco/web-extension/share-config-custom.xml
Action: It’s just only a comment, I’ll do nothing.
$ diff -c alfresco-community-distribution-201602/web-server/shared/classes/alfresco/web-extension/share-config-custom.xml alfresco-community-distribution-201604/web-server/shared/classes/alfresco/web-extension/share-config-custom.xml *** alfresco-community-distribution-201602/web-server/shared/classes/alfresco/web-extension/share-config-custom.xml 2016-02-16 17:00:14.000000000 +0100 --- alfresco-community-distribution-201604/web-server/shared/classes/alfresco/web-extension/share-config-custom.xml 2016-04-22 23:37:38.000000000 +0200 *************** *** 95,103 **** <config evaluator="string-compare" condition="Replication"> <share-urls> <!-- ! To discover a Repository Id, browse to the remote server's CMIS landing page at: ! http://{server}:{port}/alfresco/service/cmis/index.html ! The Repository Id field is found under the "CMIS Repository Information" expandable panel. Example config entry: <share-url repositoryId="622f9533-2a1e-48fe-af4e-ee9e41667ea4">http://new-york-office:8080/share/</share-url> --- 95,102 ---- <config evaluator="string-compare" condition="Replication"> <share-urls> <!-- ! To locate your current repositoryId go to Admin Console > General > Repository Information: ! http://localhost:8080/alfresco/s/enterprise/admin/admin-repositoryinfo Example config entry: <share-url repositoryId="622f9533-2a1e-48fe-af4e-ee9e41667ea4">http://new-york-office:8080/share/</share-url>
Upgrading process
$ service alfresco stop $ cp amps/alfresco-share-services.amp /opt/alfresco/amps $ cp bin/alfresco-mmt.jar /opt/alfresco/bin $ cp web-server/webapps/ROOT.war /opt/alfresco/tomcat/webapps/ $ rm -rf /opt/alfresco/tomcat/webapps/ROOT.war $ cp solr4/archive-SpacesStore/conf/schema.xml /opt/alfresco/solr4/archive-SpacesStore/conf $ vi /opt/alfresco/solr4/archive-SpacesStore/conf/solrcore.properties $ vi /opt/alfresco/solr4/workspace-SpacesStore/conf/solrcore.properties $ cp web-server/webapps/solr4.war /opt/alfresco/tomcat/webapps/ $ rm -rf /opt/alfresco/tomcat/webapps/solr4.war $ cp web-server/webapps/alfresco.war /opt/alfresco/tomcat/webapps/ $ cp web-server/webapps/share.war /opt/alfresco/tomcat/webapps/ $ /opt/alfresco/bin/apply_amps.sh $ service alfresco start
This simple process allow to identify and to apply all patches introduced by the new minor version. However, depending on your initial system, this steps can be slightly different. Please, ask an expert if you are doubting after reading a blog post like this before going hands on.