Bitnami images don't upgrade

Learn about my (mis-)adventures running this blog on a Bitnami image.

This blog runs on Ghost.  When I was originally setting it up, I wanted a fast simple way to get it running, BUT I wanted to host it myself.  That started me looking for an easy way to stand up a Ghost instance that didn't require learning about npm and configuring Apache (shudder).  It also led me down a "bad path" which I want to warn you about:  Bitnami images don't upgrade.  Read on for the full story.

Version 1 (AWS - Bitnami AMI)

My initial build was in AWS using a Bitnami Ghost pre-configured image from the AWS AMI library.  This worked great in that I was up and running fast.  I largely left the blog alone (did little to no maintenance on it).  Meanwhile, the Ghost team was making numerous upgrades and releases.  Eventually, I wanted to upgrade but the version gap was too large.  So, I exported the config and grabbed the images from the file system to migrate them.  This occurred about the same time I was consolidating my cloud presence in Azure as I moved my home lab to the cloud.

This desire to move the blog from AWS masked a deeper problem, but allowed me to remain blissfully ignorant of said problem until later.

Version 2 (Azure - Bitnami template)

When I was re-building the system in Azure, I made the same mistake as before.  I created the VM from a Bitnami template.  Again, Ghost was up and running fast.  I was able to re-import my content and get the images restored.  Happy Days....mostly.

I would do a few upgrades on this site via the ghost-cli and this time I kept the VM OS up-to-date with scheduled apt-get commands to upgrade components.  One day I log in and the blog's admin interface has a banner warning me of a security vulnerability.  Oh, I think.  Guess it's time to trigger another Ghost upgrade.  I logged in to the VM and ran the necessary commands.  However, instead of the normal 3-5 min process and green checkmarks, I got yellow and red error text...uh-oh.

"Your npm version is out of date it must match this regex."

Well, at least it's not anything serious.  I just need to update npm.  Let me fire up apt-get and get that done.  I should have been more afraid than I was at this point.  Apt-get had been scheduled to run updates on a regular basis.  So, it happily reported that everything was up to date.  This was bad.

I started searching for the upgrade instructions for npm.  I went down the rabbit hole of npm and learned about the "n" utility and the replacement for it "nvm".  I explored both these options on my system but while both happily installed and managed npm.  It wasn't the npm that Ghost was using.  A little more digging and I came to the realization that Bitnami provides all the code and dependencies for their apps in the /opt directory.  None of the native utils for either the operating system or the npm ecosystem would touch it.

Off to the Bitnami forums I went to figure out what the upgrade process was.  I browsed around and found ... nothing.  So, I started searching more generally.  I stumbled across multiple forum posts on StackOverflow with the answer:  You can't.  The images aren't designed to be upgraded.  If you want a newer version, redeploy on a new VM.  I was definitely not the only one and everyone agreed that this was a terrible solution.

Version 3 (Azure - Native Ubuntu image)

Determined to not repeat my previous mistake, I deployed a native Ubuntu VM from the Azure gallary and browsed out to the Ghost site for the install docs.  Fortunately, the Ghost team had added a much more simplified install doc for Ubuntu.  So, with about 30 mins investment, I was able to have a new server stood up.  I was old hat at migrating the content at this point and I wasn't going as many versions forward as in the past.  I was able to get all the content migrated and running on the new server.

The Lesson

If you are going to use Bitnami stacks, don't plan on being able to upgrade.  It's going to be a complete rebuild every time a dependency needs to be upgraded.  Hopefully, this helps someone else in the future.