March 29, 2020
Estimated Post Reading Time ~

Migration of Tags from AEM 6.2 to AEM 6.4

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” have 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 the system you should upgrade the location of the tag 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.

The 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 of Pages lose the tags information if the tags are not already available in the environment and this may lead to a serious issue if we lose data.

Note: Always migrate tags before you migrate pages.


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.