I have old component with different sling resource type I created a new component with new sling resource Type I want to Migrate old component node properties for ex title, description, file reference to new component properties how can I able to achieve that??
Node card = root.addNode("card","nt:unstructured");
root.getNode("card").setProperty("sling:resourceType","..../components/content/card");
Node ctaFooter = card.addNode("ctaFooter","nt:unstructured");
Now In this card component I want to bring all the properties that were using in
"sling:resourceType","../old/components/content/card"
Both sling resource type having different properties name I need a script that can perform this task
Solved! Go to Solution.
In that case you can refer second approach which I mentioned above. Use Sling Jobs and create index for your custom properties if its not covered in OOTB indexes.
You can also use groovy scripts but that would require extra efforts to setup.
https://labs.tadigital.com/index.php/2018/12/18/groovy-script-in-aem/
Try with Modernizer Tools for this use case. There is a tool to migrate legacy component to Core Components. I think it should help in your case as well.
Link :
opensource.adobe.com/aem-modernize-tools/pages/component/config.html
In case above does not work,please write a script in groovy or sling job to search for all pages where old component is used. You have to then iterate search results and add new properties with same value as older one and delete old properties.
You also need to create custom index for old properties of component so that search works fine.
helpx.adobe.com/in/experience-manager/kb/create-custom-oak-index.html
Reference for Sling Job : https://sling.apache.org/documentation/bundles/apache-sling-eventing-and-job-handling.html
The properties name are different I am asking script only
In that case you can refer second approach which I mentioned above. Use Sling Jobs and create index for your custom properties if its not covered in OOTB indexes.
You can also use groovy scripts but that would require extra efforts to setup.
https://labs.tadigital.com/index.php/2018/12/18/groovy-script-in-aem/
If the old and new component properties names are same then we can use the modernizer tool to migrate. If not you need to write a script and map the values and migrate. But i strongly feel that you might need to write a new script for this.
You can check on migration journey to cloud and take decision
The property names are different I am asking script only
Views
Likes
Replies