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

[AEM Gems Webinar] Accelerating Experience Manager as a Cloud Service development with Rapid Development Environments
Adobe Summit 2023 | Complete list of AEM Sessions & Labs
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

@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

0 Replies

Avatar

Correct answer by
Employee

@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
@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