I’m working through the docs on updating from MySQL 5 to 8.
I used ghost_production as my database value for the command in the section titled “How to Update from MySQL 5 to 8.” In return, I got a largeeee number of ALTER TABLE commands to run. Like 2 pages worth of Google Docs.
They look like this: ALTER TABLE ghost_production.webhooks CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE ghost_production.actions CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci;
Do I really just copy-pasta over and over these commands like so? mysql <database> -u <username> -p 'set foreign_key_checks=0; ALTER TABLE ghost_production.webhooks CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci set foreign_key_checks=1;'
Before you mess with the DB, I’d (1) take a server snapshot if that’s a thing your hosting setup allows, and (2) export everything from within Ghost (content and members, both - separate export steps!)
I recall doing a huge pile of alter table commands, but ended up with Ghost unwilling to start after the MySQL upgrade. So I made a new database, installed Ghost in a new directory, did a content import, a members import, and moved the images folder. Bingo, old site on new version of the database. I’m not saying that you /should/ do it that way, but if you export before you start, you’ll have the option if you need it.
I guess this is why people pay for managed hosting lol. Went to my old, infrequently updated blog, saw that I had a security warning, started a migration, and oof!
Yeah, I hear ya. I’ve got the ‘best’ of both worlds. I get to support the awesome Ghost team by hosting my client demo / testing install on Ghost Pro, AND I get to wrangle self-hosting updates and upgrades on my production site. [Dumb-sounding, but true!]
so i did this for ghost_production table, ghost starts, but i get a 502 error on my website. ghost doctor didn’t reveal anything and ghost status says it’s running.
may have to just export my posts from the database and start anew
yes, you gotta run a ton of alter table commands. i did this by copying them from the terminal, dumping them in a google doc, and then tracking which ones i ran as i went through. probably took me like 15-20 minutes of manually copying & pasting. it probably can be scripted by someone smarter than me but Gemini couldn’t manage advising me on how.
then i had this 502 error. it turns out that my .conf file mismatched the port that ghost was listening on. must have happened as part of migration:
to fix
a) run ghost status and note which port is being reported. for me it was 2368.
b) cd /etc/nginx/sites-enabled
c) ls
d) sudo nano the conf files you see.
e) proxy_pass http://127.0.0.1:2368; see that 2368? mine originally was 2369. idk why. but change it to 2368 and save the file. repeat for the other .conf file.