Is there a simple Ruby script somewhere that can be easily tweaked to do a search and replace in all posts?
I’ve migrated from MyBB and there are some tiny formatting tweaks that need to be made, e.g. replace [hr] with ----------, or convert the quote lines. I’m very new to Ruby (basically learned enough last night to submit that quoteline conversion PR), so I’m looking for a skeleton script that loops through existing posts.
remap does a search and replace on text and char columns across all tables - a little rough of a tool. Also, how would the raw → cooked conversion be handled?
Is there a higher-level way of altering and rebaking posts, that would take into account things like re-computing excerpts, quoted posts and reply relationships? The latter are especially important when fixing the quote line after the import.
@techapj I would like a rake task that does string replacements scoped to just posts, if you can add that to your todo list. It can be a variant of the rake task that already exists, just a bit more specific in what it affects…