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 vote
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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Friday in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

284 views 11 10
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