Find Replace using CLI


Iam trying to replace the URL in Space using CLI .

Approach 1:

./ --action storePage --space "zconfluencecliTarget" --title "This is title 1" --findReplace "'http://testpage:8080':'http://confluence:8080'"

In this case i could not see any change in the page

Approach 2:

./ --action modifyPage --id 105219716 --findReplace "'http://testpage:8080':'http://confluence:8080'"

Here the URL gets replaced to //testpage://testpage:8080

Could any one please help in undestanding what is going on wrong in here .

Also is there a way to search replace a URL in entire Space using CLI rather than doing it for title.

Thanks in advance,


2 answers

0 votes
Timothy Chin Community Champion May 20, 2013

Thy this?

--action modifyPage --id 12345678 --findReplace "xxx:yyy"

Thanks for the replay m

I tried ./ --action modifyPage --id 105219716 --findReplace "'http://testpage:8080':'http://confluence:8080',"

In this case the"http://testpage:8080" gets replaced to " //testpage://testpage:8080"

Please try using: "'http://testpage:8080':'http://confluence:8080',"

It is an quoting oddity that I would like to fix.

Thanks for the reply ,

Below is my confluence content :

Test page

Test page

Test page


Test page

Command:./ --action storePage --space "zconfluencecliTarget" --title "This is title 1" --findReplace "'http://testpage:8080':'http://confluence:8080',"
Page updated: 'This is title 1'. Page has id: 103229632

After firing the commands also contents remains same.

Also is there a way to update the entire Space or all the occurences in the application using CLI ?

Sorry, I should have tested it first. Even I get confused by the workaround :(. Use the following - I have put in some extra spaces so it is readable here. The inner single quotes had to be doubled:

--findReplace " ' ''http://confluence:8080'':''http://testpage:8080'' ' "

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Feb 06, 2019 in Confluence

Try out the new editing experience

Hi team, I’m Avinoam, a product manager on Confluence Cloud, and today I’m really excited to let the Community know that all customers can now try out the new editing experience and see some of the ...

1,440 views 110 8
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you