The other day I upgraded nodejs with Homebrew to a new version, and when my system rebooted a couple of days later and Phusion Passenger restarted my local install of ghost, the shit hit the fan.
Suddenly ghost complained about the dependency sqlite3 and all attempts to install it failed.
Even after downgrading to the required version of nodejs, the blog was down.
I then decided to move the data stored in the sqlite3 database into a MySQL database I already had on my system (from whaaaay back when I still used to LAMP a lot).
To my utmost dismay, the MySQL install was semi-corrupt. Several .MYD files were missing and I had upgraded to a newer version of MySQL, but forgot to run the mysql-upgrade command and now it wouldn't run and just core-dumped.
I decided to mysqldump all the databases I wanted to keep, rebuild mysql and then restore the dumps. That worked.
sqlite3 .dumped the ghost database, massaged the output to work with MySQL (mostly the dates being stored as seconds I changed to
FROM_UNIXTIME(seconds/1000)), and imported it back into MySQL.
Tada, blog restored.