Was able to test a few plugins out that do the trick:
* https://bettersearchreplace.com/ can handle updating serialized content
* All In One WP Migration https://servmask.com/ also did the trick
In the end, we opted to use ai1wm pro so that we could run this from the CLI.
wp ai1wm backup --replace "OLD-bucket-name01" "NEW-bucket-name" --replace "OLD-bucket-name02" "NEW-bucket-name"
I just recently posted on my blog about this. You can try this:
mysql> ALTER TABLE wp_comments ADD CONSTRAINT
FOREIGN KEY (comment_post_id) REFERENCES wp_posts(ID);
This will help with the comments that are made to posts that don’t exist yet.
I posted some PostgreSQL specific tips that could be utilized to fight some of these spam attacks as well here:
Combating comment spam with PostgreSQL.
Cheers,
Robby