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
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

How rename JCR node name using curl command.

cthantap1
Level 1
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
shelly-goel
Correct answer by
Community Advisor
Community 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

6 Replies
shelly-goel
Correct answer by
Community Advisor
Community 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

cthantap1
Level 1
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
shelly-goel
Community Advisor
Community 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
cthantap1
Level 1
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