Missing images after updating

As per @Cathy_Sarisky’s recommendation, I am attempting to upgrade our site from 5.71.0 to 5.120.0. After updating to the new version, all of our images (featured images, site logo, etc.) cannot be found in the browser. Everything else functions. I’ve been trying to ChatGPT a solution but nothing’s working. Can anyone help?

Not without more info! What specifically is happening? Errors in the browser console? Errors in the Ghost logs?

A post was merged into an existing topic: Ghost Not Starting Due to content Folder Permissions

Sure, sorry about that. Here’s what I get in terminal when I run ghost update:

I then restart Ghost, upload our theme .zip file & routes.yaml file in the Ghost admin UI.

Everything works but all of the images are gone:

For example if I try to go to oursite.com/content/images/size/w2400/2025/02/image.png (one of the blog post feature images) - I just get a “file not found” error.

Strangely, if I run ghost log, the events are all from October of 2023, which is when we started the site.

Very confused!

There’s no reason you’d need to upload your theme or routes file again after updating.

But… it looks like there’s a problem with the path file in your config file. Could you please post your config file, minus secrets?

A problem with the path would be consistent with the images being gone, and the logs being wrong, and perhaps needing to load theme and routes, too!

1 Like

Sure, here’s the config file:

FYI, there are a few versions of the config file in our /var/www/ghost/ directory:

Screenshot 2025-05-17 at 9.40.25 PM

Mine includes this section, which you may want to add, and then restart Ghost:

  "paths": {
    "contentPath": "/var/www/sws/content"
  },

(Obviously, you should replace it with the path to YOUR content.)

Hi Cathy, I added the recommended section to my config file:

However, when I restart Ghost, this is what I see in the browser:

If I go ahead and upload the theme file, I also have to upload the routes file. If I do both, all of the images are gone. This is without updating Ghost – just making the change you suggested to the config file.

Adam,

Do you have a full image from the server from shortly before things went weird? It might be restoring to it, if so. (Many VPS providers offer this, and some even auto-generate it every so often.)

It’s not surprising that the theme isn’t found, because you uploaded it while the content path was missing/mis-set, right?

I think you’re going to need to take a look through your Ghost directories and see if you can figure out where the images actually are. Set the content path to that (if it isn’t nested within a specific version), or move the images folder into the content path.

The post content lives in your database and is likely safe. The images should be in an images folder (with nested year-date folders inside). The theme and routes should be there, too, in themes and settings, iirc. So, assuming you can’t restore the whole server from a recent backup, my best guess is that you want to go looking for the content that should be in the content path, and put it there.

Best guess - YMMV.

Okay Cathy, thanks for the tips. I have backups of the DO droplet and have already rolled it back so that’s not a problem. I just want to fix this so I can get Ghost updated. I’ll post here when I find the solution.

Ok, it looks like the images, theme file, etc. are all in the /var/www/ghost/current/content directory.

I changed the config file to include this:

  "paths": {
    "contentPath": "/var/www/ghost/current/content"
  },

After changing the config file and restarting Ghost, the site worked. However, after updating Ghost, I ran into the same issue after restarting - theme and images missing.

What would you recommend doing?

‘current’ isn’t going to be stable over an upgrade. I think it’d be best to move the content folder out of current and into the Ghost root directory (where it normally is). And then specify that by updating your config.production.json file.

Whew, finally got this working.

I added the following to my config.production.json file:

  "paths": {
    "contentPath": "/var/www/ghost/content"
  },

… then moved all of the content from /var/www/ghost/current/content to /var/www/ghost/content.

I then ran ghost update and everything went smoothly!

Thanks again for your help @Cathy_Sarisky!

1 Like

Huzzah. Glad you were able to make it work! :)

And thank you for sponsoring! :partying_face:

1 Like