Ghost (Still) Sucks as a Blog.

In my 30-something years as an engineer and product manager, I have never seen a better example of putting style over substance than ghost, the so-called blogging engine.

Yes, it looks clean and pretty. Yes it’s quick to write a post.

If your goal is to write, it’s all good.

But if you goal is to be read, you’re hosed, because Ghost has no way for readers to find relevant info on your blog such as “all post regarding heroku”.

No search. Still. And the Github thread discussing adding it is a joke. Let me summarize: “we can’t add ANY search until we find a way to incorporate a fancy query language, have a single-source solution that works for the (3 or 4) databases we support, that works well on Gigabytes of data.”

No Tag List. First, here’s what they say about their tag feature:

Ghost tags are intended to be a super-feature – a powerhouse of customisability for your blog. Tags are a single flexible and powerful concept of a taxonomy which should provide all the features a blog could need to categorise and list posts in interesting ways. (https://github.com/TryGhost/Ghost/wiki/Tags-101)

So, tags are important, useful, so you can tag a post. And if you happen to know a tag you can see all the posts with that tag via exampleblog.com/tag/heroku but… and yes, I know this seems far too stupid to believe… they did not add a url to list the tags.

In summary, the Ghost team seems to be so busy drinking the “easy to write” Kool-aid that they seem to have completely ignored the reader your blog readers cannot search for a post… not by a simple keyword like “heroku” nor from a list of available tags.

Product mis-management like that used to be a shooting offense in silicon valley.

(My blog is now using WordPress.)

Migrating a WordPress blog to Heroku

Moved my blog from Godaddy to Heroku today.

There are several good blog posts about using WordPress + Postgres on Heroku, and in fact I did that at first. However, I could not find any info about *migrating**existing blog* data from Mysql to Postgres.

Since I wanted to migrate my old posts I was pretty sure migrating the WordPress database from MySql to Postgres was likely to introduce some problems. So I used the relatively new Heroku MySql option, ClearDB (which also has a free 5 MB option if that’s large enough for you).

The basic steps were:

  1. using Phpmyadmin on Godaddy, I backed up the database (to SQL format, the default) and downloaded the .sql file to my desktop.
  2. Created a heroku app (cedar stack) mkdir MYBLOGDIR cd MYBLOGDIR git init heroku create MY_BLOG_APP_NAME –stack cedar
  3. Downloaded and extracted the wordpress code wget http://wordpress.org/latest.tar.gz tar xzvf latest.tar.gz; mv wordpress/* . rmdir wordpress
  4. Did a git commit before fidding with settings git add . git commit -am “first checkin” git push heroku master
  5. Added a ClearDb database to the app heroku addons:add cleardb:ignite
  6. Discovered the ClearDB login credentials heroku config

Which displays

CLEARDB_DATABASE_URL => mysql://USER:PASSWORD@HOSTNAME/DBASENAME?reconnect=true
7. Using those credentials, used Sequel Pro (http://www.sequelpro.com/) on my Mac to upload the .sql file to my Heroku database
8. Copied wp-admin-sample.php to wp-admin.php and edited it with the database credentials
9. pushed the revised code back up to Heroku git add . git commit -am “added db credentials” git push heroku master
10. For pre-existing images, I downloaded the wp-content/uploads directory, copied it to my local git repo, the re-pushed to Heroku.
11. For new images, I downloaded the tantan-s3 plugin and installed it per directions… very nicely redirects uploads to my Amazon S3 account. (Of course, you could continue to manually insert images them by adding to a folder in the wp-content/uploads folder, then re-pushing the repo each time, but using S3 is easier.

That’s it, all my old blog posts were there.

I then added my domain name to my heroku app, changed my DNS to point to proxy.heroku.com, and it worked. (I did have to manually reinstall the plugins I was using. Since Heroku does not support unzipping library, you have to download locally, unzip, put in the plugins directory, then do another git push. Not too hard.)

If anyone else will see your git repo, you’d want to use ENV variables for your database password.

I also installed the WordPress SMTP plugin so mail is sent via an SMTP account instead of the php mail() function since that was causing some issues (system emails such as password reminders were not being sent). http://wordpress.org/extend/plugins/wp-mail-smtp/installation/

One more thing, if you are using permalinks…

Since Heroku will not permit the WordPress app to create/re-write the .htaccess file, you need to manually create the following .htaccess file then push to Heroku:

# BEGIN WordPress
 <IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteBase /
 RewriteRule ^index\.php$ - [L]
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule . /index.php [L]
 </IfModule>
 # END WordPress