Upgrading to AEM6 on TarMK

Upgrading to AEM6 on TarMK

The major change that AEM6 has, is at its repository level. Till CQ 5.6 version TarPM was used as a persistence manager but with AEM 6 TarPM is not supported any more by CQ. AEM 6 now comes with the MicroKernels which act as persistence managers in AEM 6.

For now AEM 6 support TarMK and MongoMK Microkernal.

Hence, upgrading to AEM 6 from CQ5.6 has three options:

  • Tar MK
  • Mongo MK
  • CRX 2 and hence not upgrading to new Oak based repository.(Since AEM 6.1 removes support for CRX2 as well)

Now the question comes Migrating to which MK suits your business the best.

The basic thumb rule is that when your requirement is performance then go for TarMK as TarMk is designed for performance and if requirement is such that you need to accommodate a growing amount of work in a capable manner then go for MongoMK as it is mainly designed for scalability.

In this article we will see how to migrate from Cq5.6 to AEM 6 on Mongo MK.


  • Java 1.7 latest version
  • MongoDB installed
  • Download crx2oak.jar file from : http://docs.adobe.com/content/docs/en/aem/6-0/deploy/upgrade/_jcr_content/par/download/file.res/crx2oak-1.0.42.jar

Migration to AEM 6 consists of two steps:

  • Inplace Upgrade in which we will put the aem6 jar file in place of the CQ 5.6 jar in AEM directory and then run the jar. This will upgrade the CQ to AEM 6, but repository will remain to be in CRX 2.
  • Then migrating the repository from CRX 2 to OAK.

Before starting with the inplace upgrade please follow the below maintenance tasks:

  • Make a backup of the instance that we wanted to migrate.
  • Disable replication.
  • Stop all running workflow instances.
  • Stop all workflow launchers.
  • Remove all the custom bundles.
  • Stop CQ
  • Disable any custom authentication mechanisms such as LDAP.
  • Start CQ.
  • Run a consistency check.
  • Run a datastore garbage collect.
  • Stop instance.

Once done with the above steps, start with the inplace upgrade and you will have a CQ 5.6 upgraded to AEM6 but with the CRX2 as the repository.

Once done with the above step now we have to migrate the AEM 6 repository from CRX2 to OAK.

Below are the steps to migrate the CRX2 to OAK on MongoMK:

  • Remove com.day.crx.sling.server bundle from CQ5.6 and shut down the instance.
  • Have the AEM 6 jar into a new folder.(AEM6Upgrade)
  • Open the folder in which you have CQ 5.6 and put crx2Oak.jar file into that.
  • Run this command “java -jar crx2oak.jar [CQ 5.6 repository] [AEM 6 repository]”
  • In our case it will be as: java -jar crx2oak-1.0.42.jar crx-quickstart\repository Oak-repository
  • Once done we will have the migrated data into the Oak-repository folder
  • Create a new folder backup and put the copy of the “datastore” from CQ5.6.1 repository to the backup folder, Also take a copy of segmentStore folder from newly created Oak-repository\segmentstore and put it under backupfolder as well.
  • Now go to the AEM6 folder where you have the AEM6 jar available.
  • Under AEM6 Folder create a new folder crx-quickstart/install
  • Create two CFG file under install folder as:

1)org.apache.jackrabbit.oak.plugins.blob.datastore.FileDataStore.cfg Edit the above file as below: path=./crx-uickstart/repository/datastore minRecordLength=4096


Edit the above file as below:

#Store binaries in custom BlobStore e.g. FileDataStore


  • Run the quickstart jar and stop it again after it has started.
  • Go to \crx-quickstart\repository of AEM 6 and delete all the content.
  • Copy the datastore and segmentstore from the backup folder and put it under \crx-quickstart\repository of AEM 6

Now you can start AEM 6 and test the upgraded instance.