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.