maricris-sn
9/2/2014 - 12:30 AM

Upgrading Ghost

Upgrading Ghost

# Login to your server as root

# Stop ghost service to prevent database corruption
service ghost stop

# Do some manual backups
cd /var/www
CURRENT_GHOST_TAR=/var/www/ghost-$(date +"%Y-%m-%d").tar
tar cvf $CURRENT_GHOST_TAR /var/www/ghost

# Get latest
wget http://ghost.org/zip/ghost-latest.zip

# Prep for install
rm -Rf ghost/core

# Merge
unzip -uo ghost-latest.zip -d ghost

# Fix permissions
chown -Rf ghost:ghost ghost/*

# Install
cd ghost
npm install --production

# Restart
service ghost restart

# Some gotchas if ghost doesn't run
# make sure config.js' DAEMON var is the same as `which node`