What's the fastest way to replace strings with multiple regexes in 1 million posts?

Hi @Canapin

FYI from our 1M post migration from vB3 to Discourse around six months ago:

When we migrated from vB we did all this data cleansing and bbcode tag refactoring with a lot of custom Ruby code in the migration script.

We found that worked the best for us; to clean everything up by running a lot Ruby gsub REGEX expressions on the vB posts before they were inserted into the Discourse DB.

Otherwise, you will need to run a lot of PostgreSQL queries again the Discourse raw posts and recook the posts.

After extensive testing, we decided to do all the preprocessing during migration (and not after migration). We found this to be the “faster” way to get a perfect migration done.

HTH