Ghost won't start after update to 5.16.2: "Unable to run migrations"

    OS: Ubuntu, v20.04.3 LTS
    Node Version: v16.13.2
    Ghost Version: 5.16.2
    Ghost-CLI Version: 1.23.0
    Environment: development
    Database: "ghost-local.db" file

Hello,
Some time ago, I made a ghost theme and I need to update it because it seems to have some issues. I was developing it using ghost 3.40.5 and first of all I started updating ghost to the latest available 5.16.2 (did it using ghost update command).

But now that I’m trying to start my site, I get the following error:

Running in development mode
[17:00:19] Checking system Node.js version [started]
[17:00:19] Checking system Node.js version - found v16.13.2 [title changed]
[17:00:19] Checking system Node.js version - found v16.13.2 [completed]
[17:00:19] Ensuring user is not logged in as ghost user [started]
[17:00:19] Ensuring user is not logged in as ghost user [skipped]
[17:00:19] Checking if logged in user is directory owner [started]
[17:00:19] Checking if logged in user is directory owner [skipped]
[17:00:19] Checking current folder permissions [started]
[17:00:19] Checking current folder permissions [completed]
[17:00:19] Validating config [started]
[17:00:19] Validating config [completed]
[17:00:20] Checking memory availability [started]
[17:00:20] Checking memory availability [completed]
[17:00:20] Checking binary dependencies [started]
[17:00:20] Checking binary dependencies [completed]
✖ Starting Ghost: helloworld
A GhostError occurred.

Message: Ghost was able to start, but errored during boot with: Unable to run migrations
Stack: Error: Ghost was able to start, but errored during boot with: Unable to run migrations
    at ChildProcess.<anonymous> (/home/squeak/.local/share/nvm/v16.13.2/lib/node_modules/ghost-cli/lib/utils/local-process.js:75:35)
    at ChildProcess.emit (node:events:390:28)
    at emit (node:internal/child_process:917:12)
    at processTicksAndRejections (node:internal/process/task_queues:84:21)

I searched quite a bit but didn’t find any solution for this issue. I don’t really get where it’s coming from. Anyone would have a suggestion on how to resolve/debug it?

From what I’ve been able to understand from the issue, it seems that the database should be migrated from ghost 3 to 5 (maybe some things changed in the way ghost write’s it’s data, I don’t know).
Anyone has an idea of how I could manually perform the migration so that I can get back the data of the old site in a newly installed ghost site. (since I don’t manage to update)

We have a full guide for how to perform the update here: Ghost Updates: How to update to the latest major version

The TLDR of what is wrong is you can’t jump straight from 3.x to 5.x, but the full details and steps are explained in the guide.

I have noted that the error message you’re getting is missing a whole bunch of critical information - which I’ll see about getting fixed.

Hi @Hannah ,

I have a similar problem after trying to update from 3 to 5.
from Ghost Docs I got the impression that it’s possible to update directly if you are using MySql.

My situation is that I have installed Ghost 5. When I try to run ghost run I get

Unable to run migrations

"You must be on the latest v3.x to update across major versions - https://ghost.org/docs/update/"
"Run 'ghost update v3' to get the latest v3.x version, then run 'ghost update' to get to the latest."

But trying to migrate gives this:

~ ghost migrate
✔ Checking for available migrations
No migrations needed :)

So I see to be stuck in a catch 22.
Any help resolving this is greatly appraciated.

did you do the ghost update v3 command?

I’ve been at this for a while now, so I don’t really remember. But running it now just prints that I’m already at a newer version.

@smedegaard were you able to find a solution?

same issue here. MySQL v8, ubuntu 20

+ sudo systemctl stop ghost_blog
✖ Starting Ghost: blog
A GhostError occurred.

Message: Ghost was able to start, but errored during boot with: Unable to run migrations
Help: Run 'ghost update v3' to get the latest v3.x version, then run 'ghost update' to get to the latest.
Suggestion: journalctl -u ghost_blog -n 50

Debug Information:
    OS: Ubuntu, v20.04.6 LTS
    Node Version: v18.19.0
    Ghost Version: 5.75.3
    Ghost-CLI Version: 1.25.3
    Environment: production
    Command: 'ghost start'

Additional log info available in: /home/ghost-mgr/.ghost/logs/ghost-cli-debug-2024-01-10T04_16_31_358Z.log

Try running ghost doctor to check your system for known issues.