Restored Site - URLS need to be corrected, any ideas?

Thanks. That looked easy enough. I entered the app and I ran that but it seems not to have changed the instances of the URLs in the posts.

This was the remap:

RAILS_ENV=production discourse remap //https://sub.domain.com //https://domain.com

This ran and competed on the “default” DB it took a few mins and then reported “done” with no error.

I looked at a few choice posts and nothing seemed to have changed on any posts URLs link.

I rebuilt some to test where I saw the dev.domain.com instead of the live domain.com in the links, but they remain the same.

Then I ran the same but sans the https:// and got this error

Remapping tables on default...

Error: ERROR:  duplicate key value violates unique constraint "index_post_hotlinked_media_on_post_id_and_url_md5"
DETAIL:  Key (post_id, md5(url::text))=(1001176, 547048fcd29cdac60) already exists.
The remap has only been partially applied due to the error above. Please re-run the script again.

I’m guessing there is a chat message in the DB that’s causing it to stop but not sure why. I suppose I need to somehow see that in the DB, as you can tell no my usual foray in managing discourse is never in the DB.

Finally, I re-ran the original remap, it took a few mins and reported as “done” with no errors:

RAILS_ENV=production discourse remap //https://sub.domain.com //https://domain.com

:thinking:

Maybe I need to rebake posts to see the fruits?

I thought a post rebuild was the same action on but on a post by post basis.

Or rebuild the app?