All internal links broken after restoring backup to new server

סיכום מבוסס בינה מלאכותית

A user moved a Discourse forum from one server to another, initially setting it up at temp.example.org before switching to forum.example.org. After the migration, all internal links were updated to use the temporary domain, causing them to break. meriksson asked how to fix this. itsbhanusharma explained that the import process likely used the temporary domain and recommended using the discourse remap command to correct the links, such as discourse remap temp.example.org forum.example.org. meriksson thanked them for the solution.

I recently moved a forum from one server to another. A few days later I discovered that all internal links have been changed and are now broken.

I am not completely sure, but here is what I think happened:

The forum lives on forum.example.org but when I was doing the migration to a new server, I initially set the new instance up as temp.example.org, so I could access it for testing without inconveniancing the users by taking down the old instance. Once I saw that the new instance was working, I reconfigured it as forum.example.org, did the DNS change etc.

Now I discover that internal links have been changed. Old links such as https://forum.example.org/t/example-topic/1 are changed to https://temp.example.org/t/example-topic/1 and this means that they are broken, since temp.example.org does not exist. As far as I can tell this has been done to every single link in the database.

What happened here? Did the import/restore process change all the links to include the then current (temporary) domain name?

How can I reverse this, i.e. change the domains on all the links back to the original name?

You can remap topics to correct url as described in this howto:
Change the domain name or rename your Discourse

you’d want to run something like discourse remap temp.example.org forum.example.org

Thank you very much!