Issues Upgrading Ghost 4.8.9 -> latest

Hello,
I have been tasked with upgrading a pretty old Ghost version to the latest.
Our previous version 4.8.9 was using an SQLite db and we are now looking at using MySQL via RDS.
The Docker upgrades seem to take hold ok but I am seeing some strange behavior.

  • When I publish a post it returns a 500 on screen and then doesn’t publish to the site.
  • I tried doing incremental upgrades, 4.89 > 5.0 > 5.30 etc and each time I would do an upgrade the previous post would then appear in the live site and then I cant publish a new post again.
  • So connection wise I am confident the db is getting comms and can clearly retrieve some info

I saw some stuff a little too late about issues regarding a fill install when you change db AND upgrade but its too little too late so I want to work with what I have.
Any clues gladly received

NB: The new posts are appearing in the console log, just not on the actual live page (or under published posts)

Anything informative in your server logs? Is an error thrown when you try and fail to publish?

Anything informative in the browser when the 500 error happens? (Check the browser console if you haven’t already?)

Since you can get Ghost running (ignoring the new posts issue), it might make sense to try to export the content and members, zip the content folder, and re-import to a clean install. While that’s lossy in terms of comments, member history, and multiple newsletters (see I moved servers! ), it’s probably the fastest route to fully functional.up-to-date version of Ghost with all your content.

Thanks for the reply, actually there is some additional info popping up in the console I didnt notice. On the old version posting/publishing was happening fine. So there havent been any code changes.
Not sure if this helps:

    at JSON.parse (<anonymous>)
    at i.deserialize (https://***-dev.apps.***.io/ghost/assets/ghost-fc7b85b759f27e607667914dcd685402.js:6349:13)
    at https://***.apps.***.io/ghost/assets/vendor-fff5b0b3c122441beb3170947ae27b9d.js:8016:8
    at https://***.apps.***.io/ghost/assets/vendor-fff5b0b3c122441beb3170947ae27b9d.js:7817:251
    at Map.forEach (<anonymous>)
    at e.eachTransformedAttribute (https://***.apps.***.io/ghost/assets/vendor-fff5b0b3c122441beb3170947ae27b9d.js:7817:232)
    at r.applyTransforms (https://***.apps.***.io/ghost/assets/vendor-fff5b0b3c122441beb3170947ae27b9d.js:8015:10)
    at r.normalize (https://***.apps.***.io/ghost/assets/vendor-fff5b0b3c122441beb3170947ae27b9d.js:8029:265)
    at r.normalize (https://***.apps.***.io/ghost/assets/vendor-fff5b0b3c122441beb3170947ae27b9d.js:7929:55)
    at r [as normalize] (https://***.apps.***.io/ghost/assets/vendor-fff5b0b3c122441beb3170947ae27b9d.js:1910:9)
type or paste code here

It sort of points to the idea of the data from the db being wonky but it seems weird that it will eventually post the new post when I restart. The existing posts are visible in the live site but not in the backend console

Wait - what? Something is very weird here.

I think you’ve cut off the top of the console error message.

Whoops, not sure what happened there:

Error while processing route: posts Bad control character in string literal in JSON at position 63 (line 1 column 64) SyntaxError: Bad control character in string literal in JSON at position 63 (line 1 column 64)

Im possibly clutching at straws here but the admin panel confirms I am on Ghost version 5 but I can see a reference to version 4 in this response from the Published page:

"mobiledoc": "{\"version\":\"0.3.1\",\"atoms\":[],\"cards\":[],\"markups\":[],\"sections\":[[1,\"p\",[[0,[],0,\"14.02\"]]]],\"ghostVersion\":\"4.0\"}"

Ghost switched from mobile doc to lexical in fairly early 5.x, but should automatically convert content when you open it for editing.

But it sounds like something is weird somewhere. It may be most efficient to do the reinstall, rather than playing whack a mole with db problems.

This week, I patched a bug in two year old code that causes complimentary subscriptions to expire every night, but only in SQLite. You don’t want to run it in production.

Ok will try have a think about the best way to do this.
I am doing my upgrades via Docker and ECS so essentially don’t have the CLI to play around with.
In my head when you do an upgrade this way and force the deployment it essentially does what I would consider a full reinstall

Nope. When you export/import, you write a json file and get a clean copy of the database. What you’re doing isn’t that, right?

Sort of, I was initially using SQLite, so I dumped it to a MySQL file and populated my RDS database with that (so all tables and content) but perhaps this is where the corruption may have started

Ok all fixed, thank you very much for you help Cathy.
Here is what I did in case it helps anyone else:

  • Updated Docker file to latest version
  • Deployed via ECS
  • Exported the data via the Admin Export feature
  • Reimported it via the Admin Import feature
  • Fixed
    I guess it must do a bit of a cleanup somewhere along the highway
1 Like

Oh good. I’m glad that solved your problem! :)