For the record the above worked fine. Here’s the full process that I followed:
- Set Discourse to read-only
- Created a backup
- Ran the above script
- Checked the Discourse pages were updated correctly
- Shutdown the old blog and started the new blog
- Setup a redirect from the old blog site to the new one
- Turned off Discourse read-only mode
- Reconfigured the discourse embeddings to disallow the old domain and accept the new
- Setup the embeddings on the new blog.
Thanks @simon so much for help with this. ![]()