# All internal links broken after restoring backup to new server

**URL:** <https://meta.discourse.org/t/all-internal-links-broken-after-restoring-backup-to-new-server/155829>\
**Category:** Product Support\
**Created:** [June 24, 2020, 3:48pm UTC](https://meta.discourse.org/t/all-internal-links-broken-after-restoring-backup-to-new-server/155829 "2020-06-24T15:48:33Z")\
**Posts on this page:** 4\
**Page:** 1

## AI-generated summary

A user moved a Discourse forum from one server to another, initially setting it up at [temp.example.org](http://temp.example.org) before switching to [forum.example.org](http://forum.example.org). After the migration, all internal links were updated to use the temporary domain, causing them to break. [meriksson](/t/-/155829/1) asked how to fix this. [itsbhanusharma](/t/-/155829/2) 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](/t/-/155829/3) thanked them for the solution.

<div class="post-metadata">

**Author:** ![meriksson](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/meriksson/32/66712_2.png) [@meriksson](https://meta.discourse.org/u/meriksson)\
**Post date:** [June 24, 2020, 3:48pm UTC](https://meta.discourse.org/t/all-internal-links-broken-after-restoring-backup-to-new-server/155829/1 "2020-06-24T15:48:34Z")

</div>

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](http://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](http://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](http://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](https://forum.example.org/t/example-topic/1) are changed to [https://temp.example.org/t/example-topic/1](https://forum.example.org/t/example-topic/1) and this means that they are broken, since [temp.example.org](http://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?

---

<div class="post-metadata">

**Author:** ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)\
**Post date:** [June 24, 2020, 3:50pm UTC](https://meta.discourse.org/t/all-internal-links-broken-after-restoring-backup-to-new-server/155829/2 "2020-06-24T15:50:40Z")

</div>

You can remap topics to correct url as described in this howto:  
[Change the domain name or rename your Discourse](https://meta.discourse.org/t/change-the-domain-name-or-rename-my-discourse/16098)

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

---

<div class="post-metadata">

**Author:** ![meriksson](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/meriksson/32/66712_2.png) [@meriksson](https://meta.discourse.org/u/meriksson)\
**Post date:** [June 24, 2020, 3:54pm UTC](https://meta.discourse.org/t/all-internal-links-broken-after-restoring-backup-to-new-server/155829/3 "2020-06-24T15:54:55Z")

</div>

Thank you very much!

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)\
**Post date:** [July 24, 2020, 3:54pm UTC](https://meta.discourse.org/t/all-internal-links-broken-after-restoring-backup-to-new-server/155829/4 "2020-07-24T15:54:58Z")

</div>

Closed on July 24, 2020, 3:54pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
