Did a restore and all the internal links have the test URL domain, breaking all the links and I am not sure why it did not take up the correct site URL, without going into the code/db to do a mass find & replace any solutions on how to do this another way?
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:
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.
So at least I’m using the right write command, things are looking up!
Apart from this rails remap impasse I thought maybe if I backup the db and do a restore again it might remap the Link-urls correctly during the restore process?