Ad Code

Sunday, April 14, 2019

Migration of Tags from AEM 6.2 to AEM 6.4


Hello Everyone,

Before some weeks I got an opportunity to migrate an AEM 6.2 project to AEM 6.4 and
here in this blog I will focus on how I migrated my tags from AEM 6.2 to 6.4 or higher version.

You must be aware that till AEM 6.3, the hierarchy of tags was “/etc/tags" and from AEM 6.4 its hierarchy has been changed to “/content/cq:tags”.

So how to migrate tags from "/etc/tags" to "/content/cq:tags"?
  • The Tag Manager API supports both the legacy and the new location. When the JCR Tag Manager Factory OSGi Component starts, it detects if it is running on an upgraded instance or a legacy one, and uses the appropriate location.
  • The TagManager API takes the tags as per precedence and obviously “/etc/tags” has higher precedence. If there are tags available in “/etc/tags” then Tag Manager api will be working with “/etc/tags” location and you don't need to change anything.
  • It is recommended if you are upgrading system you should upgrade the tags location also and you can directly copy and paste tags under “/content/cq:tags” and it will not impact any tagged pages as tagpicker never stores the absolute path. It stores the relative path.
Replace the references to the old model (/etc/tags) with the new one (/content/cq:tags) by using the tagID.

  • Log in to CRXDE Lite.
  • Move the tags from "/etc/tags" to "/content/cq:tags".
  • Restart the OSGi Component com.day.cq.tagging.impl.JcrTagManagerFactoryImpl.
Note:Important to note here the Tagging Console will also show the tags as per the precedence of the hierarchy.If AEM contains the “/etc/tags” hierarchy then the tagging console will show the tags under this hierarchy else it will show the tags under “/content/cq:tags”.
Again if it is not showing as per the expectation you need to follow step 3 mentioned above.

Issue in Migrating Content from one environment to another in AEM 6.4
While migrating the content from one environment to another environment, I noticed that If
you have pages tagged with tags,and then you need to migrate content, always migrate
tags first and then pages because Pages loose the tags information  if the tags are not
already available in environment and this may lead to a serious issue if we lose data.

I notice this thing in AEM 6.4 , I am  not sure if it is with other versions of AEM, so
always migrate tags before you migrate pages.

If you have any query or suggestion then kindly comment or mail us at sgaem.blog02@gmail.com

Hope it will help you guys !!
Thanks and Happy Learning.

Compilation Issue in AEM 6.4

Hello Everyone,

While upgrading the AEM instances with service packs you may get sometimes
compilation errors something like :
tmpFile.renameTo(classFile) failed
(:\org/apache/jsp/libs/granite/ui/components/foundation/layouts/tabs\tabs_jsp.classtmp
->:\org/apache/jsp/libs/granite/ui/components/foundation/layouts/tabs\tabs_jsp.class)

Refer to the screenshot for detailed error:

Sometimes this issue come for resourceType you have used in dialog and that's why dialog also doesn’t open and in console you can see "core.js" breaking.

Reason: While adding service packs or other kind of packs in AEM instance that overwrite the old jsp. Sometime the JSP classes will not get compiled automatically in Adobe Experience Manager(AEM).  Strange UI issues can compilation errors may be seen in the logs. In AEM6.4 libraries are no longer under /var/clientlibs folder, they are in the file system now.


Solution:
a) Recompiling the JSP classes with steps below will resolve many of such issues:  


b) For clientlibs access , click Invalidate Caches then click Rebuild Libraries.  

 
Another way to delete the cache from file system is:

a) For classes and Sightly cache:

  • Go to system console and search for “Apache Sling Commons FileSystem ClassLoader”.
  • Check the bundle number of the above mentioned bundle.
  • Go to filesystem  crx-quickstart/launchpad/felix/bundles/bundle-x/data/classes
  • Delete all the files under classes folder.


b) For clilentlibs cache
  • Go to system console and search for “Adobe Granite UI Clientlibs”.
  • Check the bundle number of the above mentioned bundle.
  • Go to filesystem  crx-quickstart/launchpad/felix/bundles/bundle-x/data/outcache
  • Delete all the files under outcache folder.

If you have any query or suggestion then kindly comment or mail us at sgaem.blog02@gmail.com

Hope it will help you guys !!
Thanks and Happy Learning.