Images no longer working after migrating to VPS

I have recently generated a droplet in DigitalOcean for my blog after the old installation in my VPS was having issues with upgrading. I had backed up my data using the exported and copied the content folder. After installation of the new droplet, I imported my data form the json and the content got imported fine. Then I copied the images in my content folder that I had backed up to the images folder in the new installation. But the images are still not loading for my blog.

I did a it of troubleshooting and found out that the records for the posts and other things are referring to a folder /abcd/content/images/2019/01/abcdefgh.png whereas any new images created in the new installation is creating the record to point at /content/images/2019/01/abcdefgh.png although the files are getting places in the same location in the file system.

Is there any way to fix this without removing the image refeneces from all posts and redoing things?

Blog URL:

Hey you can no problem, you just have to run a query in the MySQL database. Here is an example of how you can do this:

I’ve had to do this a couple of times. All you need to do is remove /abcd prefix on the string for each field.

1 Like

Thanks for the tip. Unfortunately I have already manually done the whole picture import thing and removed my earlier instance. But still, I hope this will help future visitors.

Do you back up both your sql? I used to be like you before

I am not sure I understand what you mean by “both your sql”. I used the backup built into Ghost which if I understand correctly backs up the sql db into json.