Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Migrating Comments using CommentOperation

Avatar

Community Advisor

Hello All,

I am trying to migrate comments from AEM 5.6.1 to AEM 6.2 (SP1 FP2). The comments in AEM 5.6.1 is legacy code not per OOTB comments functionality. For migrating I am looking to pick comment entries and create MSRP entries using the CommentOperation. I followed the UGC Migration Github link (by AEM Marketing Cloud) to take an idea how the comments can be generated as part of migration. The Github tool uses JSON as input, I am using JCR nodes as source.

I see that following: (comment)operations.create(resource, author, properties, attachments, session) is used to create the comment entries. In "properties" I am putting {"added":"time when comment was actually added"}

I am able to use the same logic to create the comment entries. However I see that in the entry all the time related properties i.e timestamp, latestActivityDate_dt, published -- All refer to the current time when migration was attempted. The "added" property is only reflected inside the "Object" part of the activity or notification entry.

How can I make sure while doing a create() operation that the time reflected in activities and notification is  actually that is passed in the "properties" inside create method and not the current time.

Anyone with understanding on this, please share ideas on how I could update time/date appropriately when adding such multiple comment entries(that were added in past)

 

Thanks

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

I wasn't able to change the date commented while migrating. But added new property that reflected actual commented date. I used that in my comments component hbs file to display correct date

View solution in original post

3 Replies

Avatar

Community Advisor

snbaem wrote...

Hello All,

I am trying to migrate comments from AEM 5.6.1 to AEM 6.2 (SP1 FP2). The comments in AEM 5.6.1 is legacy code not per OOTB comments functionality. For migrating I am looking to pick comment entries and create MSRP entries using the CommentOperation. I followed the UGC Migration Github link (by AEM Marketing Cloud) to take an idea how the comments can be generated as part of migration. The Github tool uses JSON as input, I am using JCR nodes as source.

I see that following: (comment)operations.create(resource, author, properties, attachments, session) is used to create the comment entries. In "properties" I am putting {"added":"time when comment was actually added"}

I am able to use the same logic to create the comment entries. However I see that in the entry all the time related properties i.e timestamp, latestActivityDate_dt, published -- All refer to the current time when migration was attempted. The "added" property is only reflected inside the "Object" part of the activity or notification entry.

How can I make sure while doing a create() operation that the time reflected in activities and notification is  actually that is passed in the "properties" inside create method and not the current time.

Anyone with understanding on this, please share ideas on how I could update time/date appropriately when adding such multiple comment entries(that were added in past)

 

Thanks

 

 

Anyone has an idea on this? The notifications and activity entries are affected by this!

Avatar

Level 1

Hi Snbaem,

As far as I know this can't be done for activities and notifications. Please file a support ticket, if you need further help on this.

Thanks

Avatar

Correct answer by
Community Advisor

I wasn't able to change the date commented while migrating. But added new property that reflected actual commented date. I used that in my comments component hbs file to display correct date