Ghost v1.0.0
was released some time ago and I've been waiting for the docker image to be updated. Now it is and I finally got some free time to upgrade.
The process was fairly easy. I would recommend trying it out locally first.
Start with pulling the new image: docker pull ghost
or if you want the smaller image docker pull ghost:alpine
.
Run it on your computer:
docker run --name ghostv1 -v /path/to/data:/var/lib/ghost/content -p 2369:2368 -d ghost
Note: contentPath
has changed to /var/lib/ghost/content
!
Then I followed the official migration guide and started with migrating my theme. For me it was just package.json
and one occurrence of {{author.image}}
that needed to be changed.
Exporting and importing the old data worked just fine. Remember to backup your old data from /content/
and perhaps the ghost.db
just to be sure.
Also the name of the config file has changed so for production just move or copy your config.json
to config.production.json
.
Start up your new container:
docker run -d --name ghost -v /path/to/data:/var/lib/ghost/content \
-e NODE_ENV=production -e url=YOUR_URL -p 2368:2368 ghost
On my first run I got a migration error from the container:
Error occurred while executing the following migration: 2-create-fixtures.js
Google wouldn't help me so my brute solution was to remove the old /data/ghost.db
since I had no use for it anyway.
Note: The environment variable (ghost uses lowercase ones for some reason) -e url=YOUR_URL
was necessary, otherwise all internal links on the blog would point to http://localhost:2368
.
After that all I had to do was to visit the blog, create my user again, import the JSON data and change to my theme!
The container script creates a couple of default posts, to remove all of them just delete the Ghost user in the settings (/ghost/#/team
).