Here’s a useful script for WP-CLI from Jay Wood…

Here's a useful script for WP-CLI from Jay Wood that scrapes all posts for shortcodes on a site, even if they're not registered. It provides you with a report when it's complete, with a CSV export option. This may come in handy when you're replacing or phasing out shortcodes, or bringing old content into Gutenberg.