Sunday 23 September 2018

Upgrade AEM 6.2 to AEM 6.4

AEM instance can be upgraded to 6.4 version in two ways.

  1. New AEM 6.4 setup
  2. In-place upgrade
Let's c In-place upgrade process.

In-place upgradation Process:

  1. Start you AEM 6.2 instance.
  2. Check all consoles are working fine.
  3. Remove all custom code and configs.
  4. Check “quickstart.properties” file is present under /crx-quickstart/conf. If not, copy from other instance and paste it in above location.
  5. Run offline compaction to reduce repository size. Check how to run offline compaction.
  6. Goto packageshare and download the package 

    pre-upgrade-package-cq62-1.2.zip


  7. Navigate to package manager and install the 

    pre-upgrade-package-cq62-1.2.zip

  8.  Once package is installed, navigate to OSGI Config Manager. Search for "preupgrade". Look for com.adobe.aem.upgrade.prechecks.mbean.impl.PreUpgradeTasksMBeanImpl.
Lets see what these are parameters do:
VersionPurge: This can be used to purge page versions.
GenerateBundlesListFileTask: List of bundles will be checked and placed in some path. This path can be found in your log.
DisableReplication: Disable replication agents
WorkflowPurgeTask:  Purge workflow. I not used while performing upgrade as I don’t have any workflow purge settings.
com.day.cq.audit.impl.AuditLogMaintenanceTask: Audit log in logger.
NOTE: If you run any task which you not configured then pre-upgrade task gets fail.
10.Once all necessary settings are added , open JMX console and select PreUpgradeTasks”.

11. Open error.log and check below entries in logs

23.09.2018 11:30:55.155 *INFO* [sling-threadpool-afcaa079-0115-490c-885f-2041bf40c356-(apache-sling-job-thread-pool)-1-Pre Upgrade Tasks Queue(com/adobe/aem/preupgrade/job/RunAllPreUpgradeTasks)] 
com.adobe.aem.upgrade.prechecks.tasks.impl.RunAllPreUpgradeTasksImpl com.day.cq.wcm.core.impl.VersionPurgeTask task finished running successfully.
...............................................................................................................................................................................
..............................................................................................................................................................................
23.09.2018 11:31:05.455 *INFO* [sling-threadpool-afcaa079-0115-490c-885f-2041bf40c356-(apache-sling-job-thread-pool)-1-Pre Upgrade Tasks Queue(com/adobe/aem/preupgrade/job/RunAllPreUpgradeTasks)] 
com.adobe.aem.upgrade.prechecks.tasks.impl.RunAllPreUpgradeTasksImpl WorkflowPurgeTask task finished running successfully.
...............................................................................................................................................................................
..............................................................................................................................................................................
23.09.2018 11:31:16.118 *INFO* [sling-threadpool-afcaa079-0115-490c-885f-2041bf40c356-(apache-sling-job-thread-pool)-1-Pre Upgrade Tasks Queue(com/adobe/aem/preupgrade/job/RunAllPreUpgradeTasks)] 
com.adobe.aem.upgrade.prechecks.tasks.impl.RunAllPreUpgradeTasksImpl GenerateBundlesListFileTask task finished running successfully.
...............................................................................................................................................................................
..............................................................................................................................................................................
23.09.2018 11:31:21.229 *INFO* [sling-threadpool-afcaa079-0115-490c-885f-2041bf40c356-(apache-sling-job-thread-pool)-1-Pre Upgrade Tasks Queue(com/adobe/aem/preupgrade/job/RunAllPreUpgradeTasks)] 
com.adobe.aem.upgrade.prechecks.tasks.impl.RunAllPreUpgradeTasksImpl DisableReplicationAgentsTask task finished running successfully.
...............................................................................................................................................................................
..............................................................................................................................................................................
23.09.2018 11:31:21.229 *ERROR* [sling-threadpool-afcaa079-0115-490c-885f-2041bf40c356-(apache-sling-job-thread-pool)-1-Pre Upgrade Tasks Queue(com/adobe/aem/preupgrade/job/RunAllPreUpgradeTasks)] 
com.adobe.aem.upgrade.prechecks.tasks.impl.RunAllPreUpgradeTasksImpl RunAllPreUpgradeTasks task finished running successfully.
12. Stop AEM 6.2 server and remove files under crx-quickstart/launchpad/installer.
13. Place your AEM 6.4 jar on the same place where AEM 6.2.jar placed.
14. Run the below command:
D:\CQ5\CQ5\AEM6.2>java -Xmx4096m -jar AEM_6.4_Quickstart.jar -unpack
Once done successfully we will be getting below message
Quickstart files unpacked, server startup scripts can be found under //crx-quickstart/bin

15. Run below command to change repository to segment tar. 

D:\CQ5\CQ5\AEM6.2>java -Xmx4096m -jar AEM_6.4_Quickstart.jar -v -x 
crx2oak -xargs - -load-profile segment-no-ds

23.09.2018 12:17:34.203 INFO c.a.g.c.e.MigrationRunner: migration completed

 __   __         __        ___ ___  ___  __

/  ` /  \  |\/| |__) |    |__   |  |__  |  \

\__, \__/  |  | |    |___ |___  |  |___ |__/

16. Start AEM 6.4.
17. It starts new segment tar repository and also perform re-indexing. Grab some coffee and wait till you see the below message in log.

org.apache.jackrabbit.oak.plugins.index.IndexUpdate Reindexing completed

18. Navigate to product information console to see the product version.


7 comments :

  1. Hi,In step #3 what exactly means by remove all custom code and configs?

    ReplyDelete
  2. can you please explain more about step 3. Thanks!

    ReplyDelete
  3. It Means your repository should not have any of your client/project code in apps folder. i.e no JSP/HTL files config files and your Jars should be present in your apps folder other than the ones that are present by default.
    i.e your AEM 6.2 instance should have only images and pages. After content is migrated to AEM 6.4 you need to make some changes in your pom files of your project eg change uber jar version and perform fresh maven build into the new upgraded AEM 6.4 instance..

    ReplyDelete
    Replies
    1. hey Oliver, thanks for your response, do we also need to remove all the custom components that we built under apps/myProject folder . if that is the case, how about the pages referring those components will not throw errors? while doing upgrade.


      Many Thanks..

      Delete
  4. Hello when trying to do a repo migration, getting below error. Can you let me know how to fix it?

    java.io.FileNotFoundException: /crx-quickstart/repository/segmentstore/data01908z.tar (too many open files).

    ReplyDelete