Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Forcing old date for properties such as cq:lastReplicated and cq:lastModified

Marcelo___ciand
Level 2
Level 2

We have migrated content from a different CMS to AEM, by recreating content in an intermediary environment and finally deploy packages from that environment to the production environment. That being said, all the properties that control dates (creation, modification, activation) are considering the dates where the content was re-created e published.

The problem is that this way we can neither keep the original chronological order of the pages (as in the previous CMS) nor display on the page the original date when the text was published.

What is the recommended solution? Could we create a script to performa a bulk update on those properties using the original dates value? Would we need to do it for both author and publish? Is there any side effect on doing it, any inconsistency?

Thank you.  

0 Replies
smacdonald2008
Level 10
Level 10

This is the way AEM works when you publish content - its only a node with a prop. To AEM, when the node was created - that is when these various props are set. 

Having said that - you can try and use the JCR API to update these date nodes to a different date value. This would require  API code to locate the node, set its props and then save the AEM session. 

To learn how to work wih the JCR API - see this article: 

https://helpx.adobe.com/experience-manager/using/programmatically-accessing-cq-content-using.html

dragon2A
Level 6
Level 6

Hi Marcelo,

 We have similar situation in my project. As suggested by scott We can update the content by using the JCR API but problem there is whenever we do modifications again we need to run in both author and publisher as well. When we activate the pages the published date again will get change. What we are doing , we have created a new property named like "old published date" for all the migrated pages/articles. while displaying the pages in UI we are checking the existence of the old publish date.  

Thanks

kautuk_sahni
Community Manager
Community Manager

Hi 

 

I was reading few days back about to change JCR node without changing its timestamp....

See, i guess, this could be of some help to you:-

Link:- http://stackoverflow.com/questions/28334796/is-there-a-way-to-modify-a-jcr-node-without-changing-its...

~kautuk

Anoop_Garg
Level 3
Level 3

Try to disable workflows from launcher. Few days back we have faced same issue for our DAM assets and I have fixed the same by disable workflows from launcher.

Marcelo___ciand
Level 2
Level 2

Anoop, I did not understand how it could help me. Could you elaborate a little more? Thank you.