Ghost content not found after rename

  • localhost
  • 5.7.1
    And
  • ghost-cli
  • 16.13.0
  • none
  • rename ghost root folder

I’m running ghost on localhost only, it’s not a publicly hosted site

I renamed the folder where I installed ghost, but now when I start ghost the content is missing and it takes me to the setup page. I see my content in the ghost-local.db file, so what do I have to do to help ghost find this data?

Here’s some log output when starting ghost with -D -V

% ghost start -D -V

Love open source? We’re hiring Node.js Engineers to work on Ghost full-time.
https://careers.ghost.org/product-engineer-node-js


[15:12:15] Checking system Node.js version [started]
[15:12:15] Checking system Node.js version - found v16.13.0 [title changed]
[15:12:15] Checking system Node.js version - found v16.13.0 [completed]
[15:12:15] Checking current folder permissions [started]
[15:12:15] Checking current folder permissions [completed]
[15:12:15] Validating config [started]
[15:12:15] Validating config [completed]
[15:12:15] Checking memory availability [started]
[15:12:15] Checking memory availability [completed]
[15:12:15] Checking binary dependencies [started]
[15:12:15] Checking binary dependencies [completed]
✔ Starting Ghost: ghost-local

------------------------------------------------------------------------------

Your admin interface is located at: 

    http://localhost:2368/ghost/

(base) rob@MacBook-Air-2 climate_change_answer % ghost log

Love open source? We’re hiring Node.js Engineers to work on Ghost full-time.
https://careers.ghost.org/product-engineer-node-js


[2022-08-03 15:11:22] WARN Ghost was running for a few seconds
[2022-08-03 15:12:16] INFO Ghost is running in development...
[2022-08-03 15:12:16] INFO Listening on: 127.0.0.1:2368
[2022-08-03 15:12:16] INFO Url configured as: http://localhost:2368/
[2022-08-03 15:12:16] INFO Ctrl+C to shut down
[2022-08-03 15:12:16] INFO Ghost server started in 0.422s
[2022-08-03 15:12:16] INFO Database is in a ready state.
[2022-08-03 15:12:16] INFO Ghost database ready in 0.544s
[2022-08-03 15:12:16] ERROR

NAME: NotFoundError
CODE: ENOENT
MESSAGE: The currently active theme "casper" is missing.

level: normal

"name: casper"
"path: /Users/rob/projects/climate_change_answer/content/themes/"

[2022-08-03 15:12:17] INFO Stripe not configured - skipping migrations
[2022-08-03 15:12:17] INFO Ghost booted in 1.336s
[2022-08-03 15:12:17] ERROR

CODE: ENOENT
MESSAGE: ENOENT: no such file or directory, stat '/Users/rob/projects/climate_change_answer/content/themes/casper'

Error: ENOENT: no such file or directory, stat '/Users/rob/projects/climate_change_answer/content/themes/casper'

[2022-08-03 15:12:17] INFO Adding offloaded job to the queue
[2022-08-03 15:12:17] INFO Scheduling job update-check at 41 33 0 * * *. Next run on: Thu Aug 04 2022 00:33:41 GMT-0700 (Pacific Daylight Time)
[2022-08-03 15:12:17] INFO Ghost URL Service Ready in 1.888s
[2022-08-03 15:12:26] INFO "GET /ghost/" 200 65ms
[2022-08-03 15:12:27] ERROR "GET /ghost/api/admin/users/me/?include=roles" 403 264ms

NAME: NoPermissionError
MESSAGE: Authorization failed

level: normal

"Unable to determine the authenticated user or integration. Check that cookies are being passed through if using session authentication."
NoPermissionError: Authorization failed
    at authorizeAdminApi (/Users/rob/projects/climate_change_answer/versions/5.5.0/core/server/services/auth/authorize.js:33:25)
    at Layer.handle [as handle_request] (/Users/rob/projects/climate_change_answer/versions/5.5.0/node_modules/express/lib/router/layer.js:95:5)
    at next (/Users/rob/projects/climate_change_answer/versions/5.5.0/node_modules/express/lib/router/route.js:144:13)
    at authenticate (/Users/rob/projects/climate_change_answer/versions/5.5.0/core/server/services/auth/session/middleware.js:28:13)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

[2022-08-03 15:12:27] INFO "GET /ghost/api/admin/site/" 200 5ms
[2022-08-03 15:12:27] INFO "GET /ghost/api/admin/authentication/setup/" 200 12ms
[2022-08-03 15:12:27] INFO "GET /ghost/api/admin/authentication/setup/" 200 4ms

Could somebody show me an example for the global ghost config file? For me, the content is simply

{
  "instances": {}
}

Can’t tell if this is right or not and I can’t find any information or examples online. Plus, running ghost doctor says nothing about this either. So helpful.

I resolved the issue. Somehow the local config file, config.development.json was pointed at the wrong db file. It was referencing ghost-dev.db and my content is located in ghost-local.db. Is there some kind of special flag I have to use to access this file instead of the other? I don’t see any mention of this in the ghost help output. How did all of my content get added to ghost-local.db if my config files were always pointed at ghost-dev.db?