Replacing a text string in all pages for the entire SPACE

Scott Cottrell March 20, 2019

Hello, need to do a quick and dirty search and replace. It's just a one-time thing, but it's for hundreds of pages so I thought the best way to handle it is to run an Update query directly on the BodyContent table in SQL.

I did that successfully, and now the pages are showing the "newString" and not the "oldString".

However, when I go to Edit the page, "oldString" is showing up in the Editor.

Is this data stored somewhere else in the database?

Thanks

-sc

1 answer

1 accepted

0 votes
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 20, 2019

Did you have Confluence shut down when you did this, and re-index it afterwards?

Scott Cottrell March 20, 2019

Hello, thanks for the response.

I did neither, I did restart the services on the server and when that didn't work rebooted the server in case there was an additional service caching data.

What kind of re-indexing is suggested, the Search Indexes? or some stored procedure on SQL?

Thanks again

-sc

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 20, 2019

Oh, well, that could explain it - the cached data persisted because Confluence was running.  A restart after hacking with SQL isn't good enough, it could have made its way into disk caches and then back into the database.

You should never, run SQL on a running Atlassian application, you can lose everything.

In this case though, it should be ok and fixable without resorting to backup.  Stop Confluence and re-run the SQL.  Restart it, then re-index

The re-indexing is the search index, yes, it needs to know you've updated the content outside Confluence.

Scott Cottrell March 21, 2019

Thanks, that is very helpful. I will follow that advice in the future.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events