# Image links point to Incorrect (Previous) subdomain After Migration

**URL:** https://meta.discourse.org/t/image-links-point-to-incorrect-previous-subdomain-after-migration/77884
**Category:** Support
**Created:** [January 12, 2018, 8:05pm UTC](https://meta.discourse.org/t/image-links-point-to-incorrect-previous-subdomain-after-migration/77884 "2018-01-12T20:05:34Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![SouperC](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/souperc/32/62875_2.png) [@SouperC](https://meta.discourse.org/u/SouperC)
#### Post date: [January 12, 2018, 8:05pm UTC](https://meta.discourse.org/t/image-links-point-to-incorrect-previous-subdomain-after-migration/77884/1 "2018-01-12T20:05:34Z")

</div>

I migrated my discourse install from one host to another yesterday and I’ve come across a peculiar issue.  
During the migration, I created a forums2 subomain, assigned what would be the new IP for the forums to it then moved the DB and files over.

Once that was done and working, I updated forums2 subdomain name to “forums”

It’s been behaving pretty well, but I noticed a strange issue with the images in this topic:

> **[\[For Fun\] Alternate uses for Kart Motors](https://forums.kartpulse.com/t/for-fun-alternate-uses-for-kart-motors/830)**
>
> \[image\]\[image\]\[image\]\[image\]\[image\]

The images are not visible and the the HTML points to forums2 as being the image source. Yet if I edit the post, the images are visible and only refer to the relative url path.

An ideas how I might have caused this, or how I can resolve it. I rebaked the posts, that didn’t seem to help.  
I noticed the domain was incorrect in my app.yml, fixed, rebuilt, but the problem persists.

---

<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: [January 12, 2018, 8:08pm UTC](https://meta.discourse.org/t/image-links-point-to-incorrect-previous-subdomain-after-migration/77884/2 "2018-01-12T20:08:23Z")

</div>

This maybe helpful for You but wait for an advice from @pfaffman first

> [@Images tombstoned after import](https://meta.discourse.org/t/images-tombstoned-after-import/74912):
>
> It seems that after an import images get moved to tombstone. I run rake uploads:recover\_from\_tombstone and they come back, but I would rather figure out how to avoid waiting for them to get tombstoned and then move them back. I’ve seen @gerhard recommend running redis on the dev box, but I just do a backup and move them to production. Is that what my problem is?

---

<div class="post-metadata">

### Author: ![SouperC](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/souperc/32/62875_2.png) [@SouperC](https://meta.discourse.org/u/SouperC)
#### Post date: [January 12, 2018, 8:12pm UTC](https://meta.discourse.org/t/image-links-point-to-incorrect-previous-subdomain-after-migration/77884/3 "2018-01-12T20:12:03Z")

</div>

Thanks Bhanu. I don’t think they got tombstoned (Classic term for it). I think it was more of a misstep on my behalf with the subdomains and app.yml

---

<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: [January 12, 2018, 8:15pm UTC](https://meta.discourse.org/t/image-links-point-to-incorrect-previous-subdomain-after-migration/77884/4 "2018-01-12T20:15:14Z")

</div>

Did You try Rebaking Posts then?

Ps: I mentioned to wait for some experienced advice.

---

<div class="post-metadata">

### Author: ![SouperC](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/souperc/32/62875_2.png) [@SouperC](https://meta.discourse.org/u/SouperC)
#### Post date: [January 12, 2018, 8:17pm UTC](https://meta.discourse.org/t/image-links-point-to-incorrect-previous-subdomain-after-migration/77884/5 "2018-01-12T20:17:16Z")

</div>

> [@itsbhanusharma](#):
>
> Did You try Rebaking Posts then?
> 
> Ps: I mentioned to wait for some experienced advice.

Yeah I rebaked and It didn’t seem to help. I understand, an appreciate your help ✊

---

<div class="post-metadata">

### Author: ![SouperC](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/souperc/32/62875_2.png) [@SouperC](https://meta.discourse.org/u/SouperC)
#### Post date: [January 12, 2018, 10:06pm UTC](https://meta.discourse.org/t/image-links-point-to-incorrect-previous-subdomain-after-migration/77884/7 "2018-01-12T22:06:18Z")

</div>

Update, rebuilding the app after correcting app.yml did not fix the image links. The still point to forums2 subdomain.

I’m guessing this has something to do with the initial import being done when it was still under that subdomain? Any ideas on how I can fix this?

Here’s an example again. You can see the source for the images points to forums **2**.kartpulse.com  
For now I have the forums2 subdomain pointed to the same IP as forums to the images will at least appear.

> **[Fuel Injected Two Strokes arrive in 2018 From KTM](https://forums.kartpulse.com/t/fuel-injected-two-strokes-arrive-in-2018-from-ktm/517)**
>
> Something for Karting here? I keep hearing inklings here and there in the industry that KTM are scoping karting as a market. No mention of the displacements in the press release, but something to ponder for karts perhaps edit… Nope, not an option...

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [January 12, 2018, 10:15pm UTC](https://meta.discourse.org/t/image-links-point-to-incorrect-previous-subdomain-after-migration/77884/8 "2018-01-12T22:15:58Z")

</div>

See the last part of this guide: [Change the domain name or rename your Discourse](https://meta.discourse.org/t/change-the-domain-name-or-rename-my-discourse/16098)

---

<div class="post-metadata">

### Author: ![SouperC](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/souperc/32/62875_2.png) [@SouperC](https://meta.discourse.org/u/SouperC)
#### Post date: [January 16, 2018, 3:28pm UTC](https://meta.discourse.org/t/image-links-point-to-incorrect-previous-subdomain-after-migration/77884/9 "2018-01-16T15:28:14Z")

</div>

Thanks Rafael, “remap and rebake” portion is what I was missing.  
I caught one emoji image (Non custom emoji) in a banner topic that the domain stayed with the old one. Not sure why or how, but it’s really not an issue, more of an FYI.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [June 8, 2024, 12:43pm UTC](https://meta.discourse.org/t/image-links-point-to-incorrect-previous-subdomain-after-migration/77884/10 "2024-06-08T12:43:38Z")

</div>

This topic was automatically closed after 2338 days. New replies are no longer allowed.
