However, when there is a version bump, such as when Ghost 1.0 was released, the Raspberry Pi community probably released a collective sigh as this often causes headaches for updating Ghost blogs that are hosted on a Pi (that is unless you happened to follow our guide on upgrading from Ghost 0.11.x to Ghost 1.0).
Updating Ghost 1.x.x to 2.0
At the time of writing, the latest version of Ghost is v2.0.2 (that's right, even when Ghost announced 2.0 officially, they were already on version 2.0.2!), but upgrading your Raspberry Pi hosted Ghost blog from version 1.22.x to the latest version is dead simple!
Backup, backup and backup!
Before you do anything, you should always make a backup of your Ghost blog just in case things go wrong!
Do this from the Ghost admin panel under Labs to export a
.json file, which can be used to restore your blog to a fresh install if all goes wrong! We would recommend saving this file somewhere safe.
Another way is to make a full SD card backup, which will preserve your setup perfectly and restoring is as simple as re-flashing the image file to the SD card. However, this method takes a little longer due to the time it takes to read the data from the SD card itself. We won't go into detail on how to achieve a SD card backup for your Raspberry Pi as there are numerous guides found online such as this one by Raspberry Pi themselves, which was featured in The MagPi Magazine.
Raspberry Pi and Ghost
The downside to hosting a Ghost blog on your Raspberry Pi is that the performance can be a little below-par compared to other options available. However, the Pi is a perfectly capable device, especially if you can tweak as much performance out of it as possible!
Did you know that Ghost Pi is hosted on a Raspberry Pi 2, along with two other blogs - my wife's, Simply Archer, which documents the trials and tribulations of having a baby and the birth of our son, and a test blog that I use when testing updates before making the plunge here. This is all contained on a 8GB SD card and performs spectacularly!
Here at Ghost Pi, we've recently noticed that updating Ghost takes a little more processing and horsepower than before. So much so that doing this recently caused our Raspberry Pi to hang, with the only way to resolve was to pull the power plug - an extremely risky task!
However, here are a few tips to upgrading Ghost on a Raspberry Pi:
- Stop any Ghost blogs from running before you update
- Make sure you do not do anything else on the Pi whilst updating
- Use Screen to keep an eye on the update process now and then, rather than watching until complete (for example, it takes around 10 - 15 minutes to fully update a Ghost blog running on a Raspberry Pi 2) - install by running
sudo apt-get install screenat the terminal.
Time to update your Ghost blog to 2.0!
Okay, enough rambling - let's get down to the nitty-gritty! Assuming you have backed up your Ghost blog, we can start the update process.
Once you have SSH'd into your Raspberry Pi, the following commands were run (in order) to complete the update:
[email protected] ~ $ sudo npm i -g [email protected]
This will install the latest version of the Ghost Command Line Installer using Node Package Manager (at the time of writing, this is v1.9.1). This can take several minutes, so be patient!
Once done, you can continue:
[email protected] ~ $ screen bash [email protected] ~ $ cd /var/www/ghost [email protected] ~ $ ghost stop [email protected] ~ $ ghost update --v1
These commands will start a new screen session (which allows you to leave the SSH session intact and come back to it later) when you reconnect to your Pi via SSH.
Then we will change to the Ghost installation directory (assuming you've installed it in the
/var/www/ghost directory as outlined in our previous guides. You'll then stop the instance of Ghost running, which helps eek a little more performance out of the Pi, then you'll update to the latest version of Ghost v1.0 (1.25.5) using the
ghost update --v1 command - this is important so do not skip this, unless you have already updated to Ghost v1.25.5 already!
If you had to update Ghost to the latest 1.0 version, then this can take 10 - 15 minutes usually (sometimes more, so don't worry) so grab a drink and take a break.
Tip - if you want to end the screen session and leave it running, simply press
D to detach the session, whilst leaving it active. To reconnect to the session, type
screen -r at the terminal to pick up where you left off.
If all goes well, your Ghost blog will be up-and-running again, but only on version 1.25.5. We're almost there!
Upgrade Ghost from 1.25.5 to 2.0.2
To update to Ghost 2.0.2 (the latest version at time of writing), SSH back into your Raspberry Pi and run:
[email protected] ~ $ screen bash [email protected] ~ $ cd /var/www/ghost [email protected] ~ $ ghost stop [email protected] ~ $ ghost update
Similar to the previous set of commands, except this time you'll be making the leap from Ghost version 1.25.5 to Ghost 2.0.2.
During the upgrade, Ghost will check for any potential issues when upgrading - mainly relating to the theme in use - there will be an extra step during the upgrade that will ask you if you want to review any potential errors or issues - more details on how to fix these can be found on the Ghost Docs, but if you are using the default Casper theme, you should be fine - then you'll be asked once more if you are happy to proceed with the upgrade. A simple
Y will suffice and the process should soon finish.
All that's left now is to celebrate your successful upgrade!
If you found this guide, as well as any other guides on Ghost Pi helpful, then if you wanted to buy Ghost Pi a coffee to show your support, then that would be greatly appreciated! As this site does not use any form of adverts, all the costs for running and maintaining the blog are done voluntarily so any extra would be fantastic!
Subscribe to Ghost Pi
Get the latest posts delivered right to your inbox