Try our conversational search powered by Generative AI!

CMS/Commerce search & replace - approaches



After a little advice regarding a "global" search and replace approach - so imagaine a client is rebranding and changing thier name.

The original string appears in 000's of CMS and Commerce pages and is also published in Find and needs to be replaced.

Possible options:

  1. Purely manual - hire some temps and just go through every page, block and product to find & replace!
  2. Use the import/export functionality to export files, update using some text editor, then import. 
  3. Write something using the Find API to locate pages, block and products then for every string/Xhtmlstring property replace any matching strings, saving and publishing via the API.
  4. Write SQL directly against the CMS and Commerce database tables to find & replace.

Option 1 is a little blunt, would work!

Option 2 could be a little brittle - I'venot had much success with the CMS Import/Export - it errors a lot. The Commerce one appears to be OK. The client could also do this themselves.

Option 3 seems straight forward, although it would need custom code, testing, deploying, runnning etc and would come at a cost to the client.

Option 4 I'm not sure if this is supported? We'd need to know which tables to update (Commmerce is complicated) also how do we update Find with the updated values - we'd still need to republish everything wouldnt we?

Anyone any experience with this?

Any other options?


Feb 01, 2017 11:05

I would suggest to write some code - probably a scheduled job - to iterate over the contents, make the edit/correct the data and publish it. This would also trigger the Find eventual indexing. This might not be the fastest way, but it should be safest way to do.

Feb 01, 2017 13:31
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.