# Upgrading to 5.46 Deleted Routes and Redirects and Broke All Images

**URL:** <https://forum.ghost.org/t/upgrading-to-5-46-deleted-routes-and-redirects-and-broke-all-images/38152>\
**Category:** Self-hosting\
**Created:** [April 30, 2023, 1:59pm UTC](https://forum.ghost.org/t/upgrading-to-5-46-deleted-routes-and-redirects-and-broke-all-images/38152 "2023-04-30T13:59:48Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![justincox](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/justincox/32/24125_2.png) [@justincox](https://forum.ghost.org/u/justincox)\
**Post date:** [April 30, 2023, 1:59pm UTC](https://forum.ghost.org/t/upgrading-to-5-46-deleted-routes-and-redirects-and-broke-all-images/38152/1 "2023-04-30T13:59:48Z")

</div>

I upgraded from 5.44 to 5.46 and everything has broken. Ghost deleted my Routes and Redirects configurations and broke the path for most uploaded images. I thought fixing the Routes and Redirects might correct the image issue, but it did not.

Ghost is running behind Cloudflare, which I read that some caching settings might cause an issue. I’m not sure if that’s the case or which settings I need to adjust. I also read that an issue might arise if the config file doesn’t have https:// in the URL. I confirmed that my site is configured with https://.

Edit: The only images affected are the self-hosted ones. Unsplash linked images are fine. The core Ghost platform images are fine. The logos and post images I’ve uploaded are broken.

Edit 2: It seems like all images were in the /instance/versions/5.44.0/content/images folder and not the base /instance/content/images folder. The upgrade to 5.46 didn’t move the images to the /instance/versions/5.46.0/content/images. I’m currently manually copying the content into that folder and the images are being restored. Is there a reason images are uploading to into the version folder structure which will change every time the site is updated?

---

<div class="post-metadata">

**Author:** ![mjw](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/mjw/32/30781_2.png) [@mjw](https://forum.ghost.org/u/mjw)\
**Post date:** [April 30, 2023, 3:24pm UTC](https://forum.ghost.org/t/upgrading-to-5-46-deleted-routes-and-redirects-and-broke-all-images/38152/2 "2023-04-30T15:24:58Z")

</div>

It sounds like an upgrade didn’t successfully conclude. All your files should be in the `content/` folder, not the `versions/content/` folder. A symbolic link is created to the latest version of Ghost.

I host behind Cloudflare, and this doesn’t affect updates via SSH. How are you performing the updates, and how are you copying files?

Your folder structure should look similar to this. I assume “instance” is equivalent to “ghost” below.

```auto
536152 -rw-rw-r-- 1 user user 26698502 Apr 13 14:32 backup-from-v5.41.0-on-2023-04-13-14-32-00.zip
521106 -rw-rw-r-- 1 user user 26698632 Apr 24 17:37 backup-from-v5.43.0-on-2023-04-24-17-36-31.zip
520891 -rw-rw-r-- 1 user user 26698599 Apr 27 14:05 backup-from-v5.44.0-on-2023-04-27-14-05-09.zip
525013 -rw-rw-r-- 1 user user 880 Apr 27 14:07 config.production.json
778033 drwxrwxr-x 11 ghost ghost 4096 Oct 23 2022 content/
520909 lrwxrwxrwx 1 user user 41 Apr 27 14:07 current -> /var/www/ghost/versions/5.45.1/
546696 -rw-rw-r-- 1 user user 201 Apr 27 14:07 .ghost-cli
766903 drwxrwxr-x 4 user user 4096 Apr 27 14:07 versions/

```

You may want to run `ghost doctor` when you’re done.

---

<div class="post-metadata">

**Author:** ![justincox](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/justincox/32/24125_2.png) [@justincox](https://forum.ghost.org/u/justincox)\
**Post date:** [April 30, 2023, 8:26pm UTC](https://forum.ghost.org/t/upgrading-to-5-46-deleted-routes-and-redirects-and-broke-all-images/38152/3 "2023-04-30T20:26:23Z")

</div>

The instance directory replaces the ghost directory on my instal for some reason. It’s a shared-hosting server with Opalstack. I did run ghost doctor and it reported an error, that my user folder isn’t accessible by all users, which I attribute to the shared hosting. My permissions appear to match the folder permissions you posted above. The only difference I notice is that content and versions are rwxrwxr-x not drwxrwxr-x, for whatever the d represents.

---

<div class="post-metadata">

**Author:** ![mjw](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/mjw/32/30781_2.png) [@mjw](https://forum.ghost.org/u/mjw)\
**Post date:** [April 30, 2023, 9:13pm UTC](https://forum.ghost.org/t/upgrading-to-5-46-deleted-routes-and-redirects-and-broke-all-images/38152/4 "2023-04-30T21:13:30Z")

</div>

The “d” means it is a directory, and that’s what `content` and `versions` should be. This suggests something is seriously broken with your installation.

Is `current` a symbolic link, i.e., preceded with an “l”? If so, what does it point to?

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [April 30, 2023, 9:18pm UTC](https://forum.ghost.org/t/upgrading-to-5-46-deleted-routes-and-redirects-and-broke-all-images/38152/5 "2023-04-30T21:18:17Z")

</div>

> [@justincox](#):
>
> It’s a shared-hosting server with Opalstack

Make sure your config.production.json is properly configured - `paths.contentPath` should point to a non-versioned folder (e.g. `/path/to/ghost/content` opposed to `/path/to/ghost/versions/current/content`)

---

<div class="post-metadata">

**Author:** ![justincox](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/justincox/32/24125_2.png) [@justincox](https://forum.ghost.org/u/justincox)\
**Post date:** [April 30, 2023, 11:37pm UTC](https://forum.ghost.org/t/upgrading-to-5-46-deleted-routes-and-redirects-and-broke-all-images/38152/6 "2023-04-30T23:37:22Z")

</div>

![Screenshot 2023-04-30 at 7.35.51 PM](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/3X/5/c/5c73c39dbe53556f271895707e2f04de43cce24f.png)  
This is what appears in the config file for paths.

---

<div class="post-metadata">

**Author:** ![justincox](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/justincox/32/24125_2.png) [@justincox](https://forum.ghost.org/u/justincox)\
**Post date:** [April 30, 2023, 11:38pm UTC](https://forum.ghost.org/t/upgrading-to-5-46-deleted-routes-and-redirects-and-broke-all-images/38152/7 "2023-04-30T23:38:55Z")

</div>

It is a symbolic link.

 ![Screenshot 2023-04-30 at 7.38.11 PM](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/3X/7/3/739277f07a2b2c2ce965b7b68c2b5ed5da63ac3d.png)

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [May 1, 2023, 5:24am UTC](https://forum.ghost.org/t/upgrading-to-5-46-deleted-routes-and-redirects-and-broke-all-images/38152/8 "2023-05-01T05:24:58Z")

</div>

Can you try changing it to an absolute path?

---

<div class="post-metadata">

**Author:** ![justincox](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/justincox/32/24125_2.png) [@justincox](https://forum.ghost.org/u/justincox)\
**Post date:** [May 1, 2023, 11:40am UTC](https://forum.ghost.org/t/upgrading-to-5-46-deleted-routes-and-redirects-and-broke-all-images/38152/9 "2023-05-01T11:40:08Z")

</div>

Can you give me an example?

---

<div class="post-metadata">

**Author:** ![mjw](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/mjw/32/30781_2.png) [@mjw](https://forum.ghost.org/u/mjw)\
**Post date:** [May 1, 2023, 2:25pm UTC](https://forum.ghost.org/t/upgrading-to-5-46-deleted-routes-and-redirects-and-broke-all-images/38152/10 "2023-05-01T14:25:49Z")

</div>

Typically, the base directory for Ghost is `/var/www/ghost`. Yours appears to be `/home/<redacted>/apps/ghost_app/instance`.

Therefore, the absolute path would be `/home/<redacted>/apps/ghost_app/instance/content/`.

---

<div class="post-metadata">

**Author:** ![justincox](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/justincox/32/24125_2.png) [@justincox](https://forum.ghost.org/u/justincox)\
**Post date:** [May 1, 2023, 10:33pm UTC](https://forum.ghost.org/t/upgrading-to-5-46-deleted-routes-and-redirects-and-broke-all-images/38152/11 "2023-05-01T22:33:09Z")

</div>

When changing to the absolute path, Ghost won’t boot. The errors read that the content path doesn’t exist.

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [May 2, 2023, 12:52am UTC](https://forum.ghost.org/t/upgrading-to-5-46-deleted-routes-and-redirects-and-broke-all-images/38152/12 "2023-05-02T00:52:37Z")

</div>

Can you make sure the path exists? I think you mentioned that you copied the content from `versions/a` to `versions/b` - now you’ll want to move it to `content` (make sure the path you move it to aligns with what you put in the config)

---

<div class="post-metadata">

**Author:** ![justincox](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/justincox/32/24125_2.png) [@justincox](https://forum.ghost.org/u/justincox)\
**Post date:** [May 2, 2023, 2:32am UTC](https://forum.ghost.org/t/upgrading-to-5-46-deleted-routes-and-redirects-and-broke-all-images/38152/13 "2023-05-02T02:32:24Z")

</div>

Right. The content path in the config is `"paths": { "contentPath": "content/" },` which should point to `/home/<user>/apps/ghost_app/instance/content/` since the config file is in `/home/<user>/apps/ghost_app/instance/`. When I changed it to read the full directory address, Ghost wouldn’t boot.

I manually moved the images, routes, and redirects files into their appropriate places from the `/instance/versions/5.44.0/content/` directory. However, I know Ghost is still reading the information from the `/instance/versions/5.44.0/content/` directory because I deleted the routes file from there and my routing rules broke when I rebooted Ghost despite them being in the appropriate `/instance/content/settings/` directory.

---

<div class="post-metadata">

**Author:** ![justincox](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/justincox/32/24125_2.png) [@justincox](https://forum.ghost.org/u/justincox)\
**Post date:** [May 4, 2023, 8:44pm UTC](https://forum.ghost.org/t/upgrading-to-5-46-deleted-routes-and-redirects-and-broke-all-images/38152/14 "2023-05-04T20:44:46Z")

</div>

I just updated to 5.46.1 and it again is only pulling from the versions director, not the content directory. Any idea how I can fix this so I don’t have to manually add files with every update?
