Upgrade ghost on an ec2 host
The ghost version changelog: https://gist.github.com/kirrg001
Export content from https://blog.example.com/ghost/#/settings/labs, just in case. I'm using mysql on the backend and haven't needed this yet, but, it's nice to have a data backup regardless.
Upgrade to the latest npm, ghost-cli, and knex-migrator:
npm i -g npm npm i -g ghost-cli npm i -g knex-migrator
Give group "www" sudo access (I run ghost as user.group: "www.www").
Stop the ghost service:
sudo service ghost stop
Become www and save a copy of the current configuration:
sudo su - www cd /usr/share/nginx/node/ghost rm previous cp -P current previous
Upgrade should work, mostly, failing at "restart":
Clean up and add s3 storage back in and various configuration bits:
cd current npm install ghost-storage-adapter-s3 npm install cp ../../previous/config.production.json .
Update db (This step may not be required anymore. Will confirm next upgrade.)
Copy over my theme edits (for the qr-code/google search/...)
rsync -avP ../../previous/content/themes/keith/ ./content/themes/keith/
Copy over the s3 bits (maybe that should be an npm update?)
mkdir -p ./content/adapters/storage/s3/ rsync -avP ../../previous/content/adapters/storage/s3/ ./content/adapters/storage/s3/
Clean up permissions:
sudo chown -R www.www /usr/share/nginx/node/ghost
NODE_ENV="production" npm start
Go to https://blog.example.com/ and see if it looks ok.
If it does,
exit sudo service ghost start
Reload https://blog.example.com/ again to double check.
Comment out group www sudo access: