Upgrade ghost 1 to ghost 2 in docker container


#1

Did anyone know of a docker container where in it’s possible to update ghost 1 to ghost 2? I have a JSON export from ghost 1 and my new ghost 2 is already installed. So i need to import my json into a temporary ghost 1, upgrade to ghost 2 and export in ghost 2 json format.

Alternatively perhaps somebody wrote a script to update the json file directly. But i prefer the to go the official route.

I tried myself with the 1-alpine container but even though the upgrade seems to go well on the command line, when i refresh the admin area of the webpage i still get the ghost 1 environment.

The commands i tried are as follows:

sudo docker run -d --name ghost1 ghost:1-alpine
sudo docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ghost1
setup ghost at: http://<.. ip in previous step ..>:2368/ghost/

sudo docker exec -it ghost1 /bin/bash
su-exec node ghost update
exit

sudo docker restart ghost1

I noticed that ghost (node) can not be restarted by ghost-cli because it’s PID 1 in the docker container https://github.com/docker-library/ghost/blob/4792c91799bca4e41a5f8439cf068f05e2341662/1/alpine/Dockerfile#L58

But the upgrade seems to be going well except that port 2368 can not be reused.

Perhaps this is not the best container to try this with. I’m open to suggestions because i don’t feel like installing a system myself just to upgrade a json.


#2

I have my suspicion that the message

Ghost 2.0 is now available You are currently using an old version of Ghost which means you don't have access to the latest features. Read more! 

is displayed even after ghost has been upgraded succesfully


#3

If you have ghost:2 container running you can import JSON-export from ghost:1 container directly.


#4

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