Help upgrading to version 2 using docker

I’ve been running ghost since 0.x with docker and recently upgraded successfully to 1.x. Now I wanted to update to version 2 but the only instructions I find us using ghost-cli which I’m pretty sure I didn’t use before. My notes on previous installs are unfortunately in my ghost blog which is currently dead :)

I had no success trying to use the new docker image directly to upgrade, it just fails, but I figured I could probably just use the ghost-cli on the file area, is this possible?

When trying that:

root@f37715dec0f8:/ghost/content# ls -lFa
total 0
drwxrwxrwx+ 1 node node   64 Aug 24 06:28 ./
drwxrwxrwx+ 1 1001   99  108 Aug 24 07:23 ../
drwxr-xr-x+ 1 node node    0 Jan 24  2018 apps/
drwxr-xr-x+ 1 node node  202 Aug 24 06:43 data/
drwxr-xr-x+ 1 node node   34 Jan 31  2018 images/
drwxr-xr-x+ 1 node node 2412 Aug 24 06:27 logs/
drwxr-xr-x+ 1 node node   22 Aug 24 06:28 settings/
drwxr-xr-x+ 1 node node   12 Jan 31  2018 themes/
root@f37715dec0f8:/ghost/content# ghost update
Working directory is not a recognisable Ghost installation.
Please run `ghost update` again within a folder where Ghost was installed with Ghost-CLI.

Well, I never installed anything with ghost-cli. I can’t seem to find any instructions on how to upgrade in my case. Any help highly appreciated. I know the docker thing is not the official supported setup, but pretty please?

Additional info for completeness, probably not relevant, but you never know:

So I have all the ghost data on a NAS mounted on a host Ubuntu machine. I’ve been running ghost 1.x with a docker-compose just like this:

version: '2.0'
services:
  ghost:
    #image: ghost:1-alpine
    image: ghost:2-alpine
    container_name: blog
    ports:
      - 2368:2368
    volumes:
      - /var/lib/ghost/content:/var/lib/ghost/content
    environment:
      - url=https://blog.woodenstake.se # Otherwise internal links go to localhost:2368
    restart: unless-stopped

First I got the feeling the new image had some auto-update thing (ghost/update.sh at 3557ab61ea77fef9e6894ff5eff85c340ab5707e · docker-library/ghost · GitHub) so I just tried upping the version number, but that failed miserably. It seemed to make a json backup though so I’m not really that afraid I lost my data:

viktor@i7:/var/lib/ghost/content$ ls -lFa data/
total 976
drwxr-xr-x+ 1 viktor viktor    202 Aug 24 08:43 ./
drwxrwxrwx+ 1 viktor viktor     64 Aug 24 08:28 ../
-rw-r--r--+ 1 viktor viktor 565248 Aug 24 08:34 ghost.db
-rw-rw-rw-+ 1 viktor viktor 213516 Aug 24 08:33 the-wooden-stake.ghost.2018-08-24.json

Ok, feels like the instructions didn’t fit my case at all. Turned out I was on an old 1.x:

Version 1.20.3
Environment production
Database sqlite3
Mail Direct

So first just pulled latest 1.x

sudo docker pull ghost:1-alpine

And spinned that up.

Version 1.25.5
Environment production
Database sqlite3
Mail Direct

I guess that automatically did some migrations, because after that I could spin up a v. 2 without trouble so now I’m running with

Version 2.0.3
Environment production
Database sqlite3
Mail Direct

The instructions I’ve read seem to take for granted that you’ve used ghost-cli to create the file area or something like that. I haven’t. I started with 0.x something many years ago and have just updated according to instructions. They have worked fine before, but not this time. Seems I got saved by the docker image doing good stuff, but I don’t understand why the previous approach would be wrong - it shouldn’t really matter that I’ve used docker, right?

1 Like

This feels pretty stupid though:

image

Yeah, I had the same thing. Doesn’t return after you close it though.

THANKS!!! a lot

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.