Find and Replace?


We are changing the name of one of our products, and I need to do a find and replace in our knowledge base. (Doing this by hand would be kind of ridiculous.) I'm not finding any options---does anyone else know how to do it? This plugin ( is not updated to Confuence 3.5.



2 answers

I am doing search and replace with the the Confluence Command Line Interface

using the 'getPageList', 'getPageSource' and 'storePage' actions.

Utilizing this within a shell script you can export the pages to plain text files, perform the search and replace using tools like UltraEdit and push them back to confluence again.

Thank you Thomas, but I don't think I have access to the command line because we've got a hosted instance. :( Maybe I can get support to do this though

Hi Emily,

The Remote API is open on hosted instances (or it should be, if you request it!). You also have admin access and can enable the remote API. You should be able to run a find and replace script that way, with full programmatic logic to make sure you don't make any mistakes. That is, you can output everything in a report for manual inspection first then run the replacement.

You can find the pages by running with the sql script against the database (if that's your kind of thing.) Even if you edit in Confluence this will give you the scope.

It's also possible to edit via sql but not recommended, you must take a backup(!), stop Confluence, run update, then reindex on restart. In addition to the command line interface, the webDAV interfce could also be used (if it still works.)

-- Query to locate current pages containing a specified string
-- Jim Birch 2011.01.28
select  -- top 100
 s.spacekey, c.TITLE, c.CREATOR, c.LASTMODIFIER, c.LASTMODDATE --, bc.body 
  dbo.CONTENT c
-- note: spaceid is null on old page versions so join on
-- space id selects only current pages.  Nice.
 dbo.SPACES s
 bc.BODY like '%productname%' 
order by
 s.spacekey, c.title

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Dec 18, 2018 in Confluence Cloud

Happy holidays from our team to yours!

Hi Community!  2018 was filled with changes for our team, both big and small, and we've taken a lot of time to both celebrate our wins and recognize areas of improvement. One thing that we're a...

462 views 3 18
Read article

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