Showing posts with label AEM migration. Show all posts
Showing posts with label AEM migration. Show all posts

Migrating from older version (5.6.x) to AEM 6.1


Perform the following steps to migrate AEM 5.6.1 to 6.1

Run all maintenance activities: 

  •  Data garbage collection, 
  • workflow purge, 
  • version purge,
  • consistency check, 
  • traversal check, 
  • tarPM optimization.


Make sure there is no error during maintenance activity. This is the KEY.

1. Stop the CQ 5.6.1 instance
2. Archive and delete all log files from logs folder
3. Check repository.xml if any custom login configuration then remove the same (If required)
4. Update the java version to 1.7+
5. Place AEM6.1 quickstart jar parallel to quickstart folder of CQ5.6.x
6. Unpack the quickstart jar by running:
java -jar cq-author-p4561.jar –unpack

Prepare for the migration:

  1. Run the below command

       java -jar cq-author-p4561.jar -v -x crx2oak

The step generates a file crx2oak.properties under crx-quickstart/crx2oak/
Update the logging level for upgrade log to “Debug” mode in the above generated file, then proceeded to next step.

   2. Run the jar with the same parameters second time to generate the OSGi           configurations needed for the data migration:

        java -jar cq-author-p4561.jar -v -x crx2oak

Verify the following configuration files generated to the path crx-quickstart/install
org.apache.jackrabbit.oak.plugins.blob.datastore.FileDataStore.cfg and
org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService.cfg

org.apache.jackrabbit.oak.plugins.blob.datastore.FileDataStore.cfg
path=./crx-quickstart/repository/repository/datastore
minRecordLength=4096

org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService.cfg
customBlobStore=true

Run the migration to CRX3

java -Xmx4096m -XX:MaxPermSize=2048M -jar cq-author-p4561.jar -v -x crx2oak -xargs -- -omigrate

Post migration , monitor Upgrade log and observe for below output which is correct.
***In Upgrade Log***
18.07.2015 08:55:56.729 *INFO* [com.adobe.granite.crx2oak.CRX2Oak] CRX2Oak.java:308
Conversion to SegmentNodeStore took 115408 msec
***Execution window***
Preparing to execute extension CQ5.6.1Upgrade6.1/crx-quickstart/opt/extensions
/crx2oak-quickstart-extension.jar
18.07.2015 08:54:01.103 *INFO* [com.adobe.granite.crx2oak.quickstart.extension.
Main] Main.java:151 Launched CQ5.6.1Upgrade6.1/crx-quickstart/opt/extensions/
crx2oak-quickstart-extension.jar, version 1.0.14, SHA1 checksum 86838d4c6aca9429
11cbfa97e37ef46fcedf7177.
18.07.2015 08:54:01.118 *INFO* [com.adobe.granite.crx2oak.quickstart.extension.
Main] Main.java:186 Using crx2oak.jar from CQ5.6.1Upgrade6.1\crx-quickstart\op
t\helpers\crx2oak\crx2oak.jar
18.07.2015 08:54:01.274 *INFO* [com.adobe.granite.crx2oak.quickstart.extension.
Main] Main.java:188 crx2oak version 1.2.10, SHA-1 checksum dbf845a76cb8eb0d05cc
e4494500dca75c381dce
18.07.2015 08:54:01.274 *INFO* [com.adobe.granite.crx2oak.quickstart.extension.
Main] Main.java:262 Preparing to migrate repository to TarMK
18.07.2015 08:54:01.290 *INFO* [com.adobe.granite.crx2oak.quickstart.extension.
Main] Main.java:320 Starting repository migration. Please monitor the progress
in the upgrade.log file.
18.07.2015 08:55:56.729 *INFO* [com.adobe.granite.crx2oak.quickstart.extension.
Main] Main.java:322 Finished TarMK migration in 115 seconds.
18.07.2015 08:55:58.625 *INFO* [com.adobe.granite.crx2oak.quickstart.extension.
Main] Main.java:338 Your instance was migrated to Apache Jackrabbit Oak. Please
make sure to start the upgrade by explicitly using the crx3,crx3tar run modes (
e.g. java -jar aem.jar -r crx3,crx3tar).

As you see last command does output which run mode to use
-r crx3,crx3tar to upgrade in the next step

****************
KEY : Before performing the Final Step - “Performing The AEM Upgrade”
- Delete the 5.6.x standalone jar under crx-quickstart/app/ and set permission to AEM to all
folders, each and every step.
chown –R aem:aem crx-quickstart .
****************

Final Step - “Performing The AEM Upgrade”: 

Execute the below command and constantly monitor the error.log and upgrade.log.
Command: java -jar cq-author-p4561.jar -r author,crx3,crx3tar

Most suitable command:
java –Xmx4096m -XX:MaxPermSize=2048M -jar aem-author-p4502.jar -r author,crx3,crx3tar

Verify the error log for “com.adobe.granite.repository.impl.CRX3RepositoryImpl Repository
started.” which clearly showed my repo started as crx3.
Line 1690: 18.07.2015 09:10:51.593 *INFO* [FelixStartLevel]
com.adobe.granite.repository.impl.CRX3RepositoryImpl Repository started.
Bundle Status – Make sure all the bundles are active.

Pre-Upgrade maintenance Tasks in AEM

AEM offline compaction

Use case : When AEM repository size is growing rapidly

Solution :

  1.  Create compact folder under under \crx-quickstart\repository\segemnetstore
  2. download the oak-run-1.2.2.jar file and place under compact folder created in step1
  3. create offcompact.bat file with the below code
         java -jar oak-run-1.2.2.jar compact \crx-quickstart\repository\segemnetstore
      place this .Bat file under compact folder created in step1.