I moved servers!
It went ok... mostly. Read on for the gotchas.
I've had the VPS that hosts my Ghost site (this site!) stuck at version 5.70ish for a while. I was on Ubuntu 18, and it was a series of incompatibilities that meant I couldn't upgrade Ghost to the latest version. No link searching, no recommendations, no donations, no emojis, no fix to several search and portal bugs that I'd patched for everyone else. You get the idea. I was missing out.
Yes, in theory, I could have done an apt-get dist upgrade
and everything would have been ok. But you know what they say:
In theory, there's no difference between theory and practice. In practice, there is.
I figured it was potentially a big mess of incompatible dependencies, and anyway, my hosting package was discontinued, and what was being offered was hugely better for the same price. And then Hostinger offered another really good sale. Yeah, that's like 4-8x the power of a DO droplet, at <$5. (Hostinger KVM2 specs here, but use the affiliate link above for an extra 20% off.)
There are sort of two big options for migrations. (1) Use Ghost's backup process or (2) sql dump and restore.
I've been bitten by column format and encoding subtleties before when trying to do the sql dump route, so I thought (1) was the way to go. Those directions are mostly pretty good, but there were a couple gotchas. Thinking about doing similar? Read on!
Timesaving trick:
After doing a ghost backup
, I had a 300MB zip file. Rather than downloading it and uploading it to the server, I shoved it into the old server's assets folder, and then used wget
on the new server to copy it over. Super easy, no need to set up anything fancy. (And then, of course, I moved it back out of the assets folder.)
The gotchas
API keys need to be regenerated
The backup and restore process via ghost backup and ghost import doesn't retain API keys. I needed to remember what services I had connected to Ghost, and go give them all the new API key.
Stripe tiers don't import
It's possible to move member subscriptions, by doing the following:
- Export members from the old site. (Open the file and make very sure you've got them all, because the next step is destructive)
- Delete paid members in the old site. (Click filter to select members with paid status, apply it, and click the gear to delete them.)
- Disconnect the Stripe account, being sure to note which account it was, if you have multiples (settings > access)
- On the new site: Connect Stripe, being sure to use the same Stripe account.
- Import members.
That results in imported members with their Stripe accounts connected. You and they can see their subscriptions, and everything seems OK. HOWEVER, it doesn't cause the Stripe tiers to appear in Ghost. I'm not sure if anything does.
I fussed around for a bit, trying to see if I could hack the old tiers into the database. I'm sure it's possible. I didn't get there. It was easier to just recreate the two paid tiers.
Newsletter subscriptions don't import
If you have multiple newsletters, beware! The export doesn't show you what newsletter a member is signed up for, and the import just signs anyone who was 'subscribed' (to anything?) to the default newsletter. Boo.
Phantom Admin actually has a members export that'll write out newsletter subscriptions. I sense a new feature (to then import members with newsletters correctly) coming on...
That was a nuisance, especially since I didn't discover it until I'd deleted my paying members. I'm taking it as an indication that it's time to to clean up my flock of newsletters (because I don't care for Ghost's multi-newsletter support anyway), but ugh.
Member statistics don't import
While my members' creation date got imported, when they last visited the site, their newsletter open rate, and other stats did not.
This isn't a huge loss (since I don't pay by the member anyway, I don't really care if I have some non-reading members), but it is an annoyance.
Snippets don't move
I don't know why, but when I went to add my usual sign-up snippet at the bottom of this post, I discovered it was gone. Boo.
Update: I lost my comments!
Arrrrgh. Yeah, ok, this is not a good upgrade route. Nuff said, I'm done here. Definitely going to have to try the other option... maybe next weekend? 😦
Error message?
Validation error, cannot edit post. Value in [products.name] cannot be blank. products.name
This error can happen when a post is set to a restricted tier, but the tier doesn't actually exist in Ghost, i.e. after a migration. It's a nasty error, because it means you can't actually save or publish your post drafts. (Which is why I wrote the first paragraph of this post like four times.) I was seeing it today, but I don't have any posts that are actually tier restricted. I'm not sure whether I messed something up when I was playing with the database directly (although I was careful to put everything back... I think), or what was up. Things I tried: a ghost stop
and ghost start
on the server. Deleting and re-importing paying members. Reloading the admin interface. (Browser shift-reload.) One of those fixed it. I'm not totally sure which.
Conclusions
It wasn't a terrible way to spend a few hours, but I do wish for an easier and complete migration pathway, including all the API keys, paid tiers, snippets, and newsletter subscriptions. I have a running list of 'things I'd like to contribute to the ghost core if I ever find time', and those problems are going on it!
Hey, before you go... If your finances allow you to keep this tea-drinking ghost and the freelancer behind her supplied with our hot beverage of choice, we'd both appreciate it!
Yes, so I've totally failed to use the new donation feature I said I wanted. Let's try it:
And hey, if you'd like to recommend my site, I'm ready now! 😊
Postscript: I still have my old site. I may have to go back and try the sql dump and restore route... just to see how bad it is. 🤔