Expand my Community achievements bar.

SOLVED

How rename JCR node name using curl command.

Avatar

Level 1

How rename JCR node name using curl command. as we have almost 600 nodes should be renamed. please provide best way to rename the node name.

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

@cthantap1 

You would basically have to use the move command to rename the nodes.

Here's the CURL command to rename/ move a content node. You can create a script with all the nodes that needs to be renamed with their before and after content paths.
curl -u admin:admin --header "Referer:http://localhost:4502/" -F":diff=>/apps/test1 : /apps/test2" http://localhost:4502/crx/server/crx.default/jcr%3aroot

Below is the list of all the curl commands and you can refer to the move command in it:
https://experienceleague.adobe.com/docs/experience-manager-65/administering/operations/curl.html?lan...
curl -u <user>:<password> -F":operation=move" -F":applyTo=/sourceurl/oldname" -F":dest=/sourceurl/newname" https://localhost:4502/content

View solution in original post

7 Replies

Avatar

Employee Advisor

You can use ACS common Page Relocator tool of ACS commons to rename pages in bulk https://adobe-consulting-services.github.io/acs-aem-commons/features/mcp/subpages/tools.html 

 

Avatar

Correct answer by
Employee Advisor

@cthantap1 

You would basically have to use the move command to rename the nodes.

Here's the CURL command to rename/ move a content node. You can create a script with all the nodes that needs to be renamed with their before and after content paths.
curl -u admin:admin --header "Referer:http://localhost:4502/" -F":diff=>/apps/test1 : /apps/test2" http://localhost:4502/crx/server/crx.default/jcr%3aroot

Below is the list of all the curl commands and you can refer to the move command in it:
https://experienceleague.adobe.com/docs/experience-manager-65/administering/operations/curl.html?lan...
curl -u <user>:<password> -F":operation=move" -F":applyTo=/sourceurl/oldname" -F":dest=/sourceurl/newname" https://localhost:4502/content

Avatar

Level 1
As per the below URL destination URL should end with slash where newname specified and its not taking. Do you have and example command to rename using move curl -u <user>:<password> -F":operation=move" -F":applyTo=/sourceurl/oldname" -F":dest=/sourceurl/newname" https://localhost:4502/content

Avatar

Employee Advisor
@cthantap1 - If the 2nd command isn't working for you, please go for the first one I shared. I did a test in my local when I shared earlier so that should be fine: curl -u admin:admin --header "Referer:http://localhost:4502/" -F":diff=>/apps/test1 : /apps/test2" http://localhost:4502/crx/server/crx.default/jcr%3aroot

Avatar

Level 1

Below command is working as expected

curl -u admin:admin --header "Referer:http://localhost:4502/" -F":diff=>/apps/test1 : /apps/test2" http://localhost:4502/crx/server/crx.default/jcr%3aroot

Avatar

Level 2

Can you give an example using this curl command, as u have mentioned referer which one to take as reference