November 12, 2018 · software linux

Downgrading the New Ghost Blog Editor

If you accidentally updated the Ghost blogging software like I did, blog posts are forced to be created using an editor called Koenig Editor. Unfortunately, the "user-friendly" editor claims to support Markdown, but in reality it fails to consistently do so, and makes a great big mess when creating technical content. Creating links in the new editor is extremely difficult. Also, the new editor no longer supports specifying the programming language for code-highlighting Markdown code blocks, a feature that I used in most of my blog posts. I tend to specify the language to help code-highlighting, e.g.

```java <---- this word here
Actual java code goes here
```

Anyway, I wanted to go back to the old, plain, and simple editor. The last good version is Ghost 1.25.5.

Guide to Downgrading Ghost to Version 1.25.5

Start by backing up your existing blog, by going to Settings -> Labs, and "Export your content". Make a backup of your /var/www/ghost folder as well, since images aren't backed up with the aforementioned method. Finally, go to your themes and click the download button next to the active theme.

Next, setup another Ghost installation in a different directory. If you are on a new machine, follow most of the instructions on Ghost's documentation. I've copied them here for posterity:

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash
sudo apt-get install -y nodejs

# At time of writing, version 1.9.8 is the last known-good
sudo npm install ghost-cli@latest -g
sudo mkdir -p /var/www/ghost

# Replace <user> with the name of your user who will own this directory
sudo chown <user>:<user> /var/www/ghost

# Set the correct permissions
sudo chmod 775 /var/www/ghost
cd /var/www/ghost

The following commands will install the last version of Ghost that still supports the original editor, version 1.25.5. What's great is that it also shows the new Koenig Editor for pages that were created after upgrading to Ghost 2.0, meaning that there are no downgrade or compatibility issues (at least for versions < 2.3.0).

ghost install 1.25.5 --local --db sqlite3

# Setup Ghost for production mode:
ghost setup --db sqlite3

Once that is finished, you can create an account on your new Ghost blog. Import all the previous blog posts and settings by going to Settings -> Labs -> "Import content". To restore your images, simply copy the folder ./ghost/content/images, from your old installation to your new installation directory. Finally, upload and activate your previous theme. If you are having trouble uploading the theme file, you may have an issue with your nginx configuration.