Upgrading Ghost 0.x to 3.x

Hello!

As some of you know, I freelance. I was recently tasked with upgrading a self-hosted Ghost instance from 0.11.2 to the latest version (at the time of writing, 3.40.8). As the instance was run on AWS using Bitnami, it was a lot simpler and I didn’t have to fiddle a lot to get the server up and running.

Although I initially thought it’d be a simple job, it turned out to be a lot more complex than exporting a backup, copying over images and then configuring a mail server.

First off, there’s no direct upgrade path between Ghost version 0.x and =< 1.x. You’re unable to upgrade in place, or even export a config file from a pre-1.0 Ghost instance and import it into a fresh one running the latest version. Instead, you need to convert a 0.x config file by importing it into Ghost v1.x, and then export it and import it into Ghost v3.x.

In my case, I imported the config file to a local v1.22.2 instance of Ghost installed using ghost-cli@1.11.0 running on npm 8.17.0 through nvm. This is incredibly important to note, because it seems like v1.x of Ghost is extremely fiddly to deal with and was never upgraded to handle Node 10. Thank you to the answer here for helping me figure all this out.

nvm install 8.17.0
nvm use 8.17.0
npm i ghost-cli@1.11.0
ghost install 1.22.2 --local

Quick side note: Although a patch was promised, diving into the commit history it seems the next release of ghost-cli (1.12.0-beta.0) actually phased out support for v0.x of Ghost.

After setting up, importing and exporting the data from my v1 instance in the Labs tab, I had a file compatible with a newer version of Ghost. After setting up a new Bitnami instance with Ghost, I imported the new config file and set everything up. I also moved the images through scp into the opt/bitnami/apps/ghost/htdocs/content/images folder.

Another quick side-note. If you ever get locked out of a Ghost instance, and you have access to the backend, then log into the database. When Ghost uses mysql, the brute table holds login attempts. Select all the rows in the database, try to log in again, and see which attempt counter increments. Drop that row, and your timeout resets!

I had to import Subscribers (now called Members) separately, after activating and customising the feature under the Labs tab. All that was left was to configure SMTP credentials and Mailgun credentials for Ghost, and set up an SSL certificate, and I was done!

Setting up an SSL certificate was extremely simple, and I had absolutely no problems using the automated tools Bitnami provided. I certainly didn’t have to consult a forum answer from 2017 to help me get around an infinite redirect issue.

At the end of the day, I learnt quite a bit about SQL, Apache and Ghost. It was all an extremely frustrating (yet fun!) experience and I get paid for it!

I know a couple of people who are looking to start their own businesses, and I have a few pieces of advice

Value Yourself.

Some clients are nice, and others are horrid. I started out working for people who paid me an extremely low wage for work that needed years of experience. Don’t do that to yourself. If someone doesn’t value your time, then please don’t do business with them. You’ll thank me later

Dive in Head First.

It’s the best way to learn something! On this project, I dealt with an SQL server on an AWS instance.

Although I had a bit of experience with EC2, as I’d hosted a Discord bot on it, I had never dealt with Apache and SQL. I’d heard of Ghost, but I never really used it. I dove in head first, and picked up quite a bit from working in the real world on a real project.

Bounce Ideas Off Others.

Run ideas past your friends. Seriously, though. Bouncing ideas off other people helps you realise how absurd (or genius) your suggestions are. Explaining the problem you’re trying to solve, as well as your approach to it, also helps other people suggest solutions.

Measure Twice, Cut Once.

Well, in this case, plan twice and code once. Nothing sucks more than abandoning an approach you’re taking to a problem halfway through. I could’ve saved myself a whole lot of time and headache if I read some documentation and figured out that there’s no way to upgrade from Ghost 0.x to 3.x in place. Just… read the docs.

Tinker.

Never be scared to follow your gut, and have a bit of a poke at things. Try to figure out how things work. If you think something might work in some way, take a look and try it out. (Obviously, don’t tinker with anything mission critical, though!)

Look at the results of databases after carrying out certain operations on the front end to see whether your hunches are correct. Try to guess. Although it seems silly, design decisions (also known as “best practices”, some of which are just convention) are replicated all over the place, across different pieces of software. Being able to look at something from the outside and take a good guess as to how it works on the inside is an important skill, and this is one way to train it.

Communicate With Your Clients. Clearly.

Most of them aren’t that scary. Once you get the hang of speaking to one or two, you’ll be able to handle anything that’s thrown at you! It’s important to remember that if your clients can’t take the time to speak to you, then they’re not worth your skills and expertise.

Never be afraid to ask for clarification and always communicate with them. It’s your job. Even if your client doesn’t seem that technical, they’ll most likely appreciate being kept in the loop.

Also, avoid jargon. Even though you’re a software developer and your trade’s in communicating with computers, the art of business is in communicating with people. Most clients notice I use an informal tone of voice. I even sign off (almost all) emails with “Cheers!” instead of a stuffy “Yours sincerely,” because I’m human. The Monzo (yes, the digital bank) style guide is very interesting, and I suggest you give it a read if you’re interested in communicating more clearly with clients.

Let’s be honest, communicating clearly also makes it seem like you know what you’re doing (even though you might not).

For projects with formal requirements, you’ll obviously need to check in with your clients at large milestones. However, on smaller projects where there are no milestones, it’ll be up to you to figure out when to communicate with your client. I recommend you split the project up into steps, and speak to them after you’ve completed each. Explain what you’ve done so far, what you’ve just accomplished, what it means, and what you’ll do next and what you need. It really helps.

For this particular project, my client and I exchanged about seventy-two emails in the space of three days. Obviously, nobody’s going to do that normally, but he enjoyed speaking with me and I enjoyed speaking to him.

Keep in touch, and check in on your project and previous clients. Often, when it rains, it pours.

Be Nice.

Being nice to people opens so many doors, and provides so many opportunities. Never forget that at the other end of that phone line or email, there’s someone who has to make a decision about whether to continue engaging your services. Having a little courtesy goes a long, long way.