Today I updated my ghost installation from
2.1.1. Since ghost version
1.x I updated every minor version by downloading the newest alpine ghost docker image, configuring volume mapping to the existing ghost path, starting the container and switching docker proxy rules for my domain:
This workflow does not work for updating from version
2.1.1, the database scheme has changed and the docker container does not start.
step 0 - update your ghost installation to latest 1.x and backup your content
Make sure your ghost installation is running the latest 1.x version. Then log in to your existing ghost backend, click on labs and export your content as json.
step 1 - not update, just setup a new ghost 2.x container
That's it. I created a new ghost docker container and let its volume mapping point to a new directory. This way the container starts and you can access it via its port yourdomain.tld:32768 (if your firewall configuration allows that):
Create a new ghost account to get access to the backend, and import your ghost 1.x backup. Some warnings may appear, but on first sight everything works, except local images (unsplash or other third party images should work).
step 2 - copy your images into your new ghost mapped volume
Log in to your server via ssh, and copy your images from your old ghost content folder, into your new ghost content folder. On my server, the docker user is
1000 so I must copy these folders as sudo:
user@a-sever:~/ghost-content$ sudo cp -r images/ ../ghost-content.2/
After that, all of your images should be available again.
step 3 - configure docker container url
Because you created a new docker container, you should configure the url of your installation in the docker container.
Have a look at the end of my last ghost/plesk/docker article for exact shell commands.
step 4 - check your new user account settings
Your Profile and setup your social profiles, user picture, user background etc.
Maybe it is clever, if you setup your new ghost installation not with the same account you use on your existing ghost installation. Maybe your user profile and everything will get imported properly this way. I created the same account on the new instance, I use on the old instance, and that's where the most warnings came from during the import.
I hope it'll work for you as good as it worked for me. Happy blogging!