Converted to Ghost

Easily update the posted date for blog posts during a conversion when using SqlLite as the backend.

This website was due for an update. Orchard looks like it died as a project and I wanted to get a little more modern. So I went on the hunt for a new blog engine. I found a few, some cost money, some were free.

I also had some requirements that really made me look for a new engine.

  1. This is a development site, it has to natively display code in a nice way.
  2. Markdown. It had to support MarkDown or it was a no-go.
  3. I like hosting my own stuff so that was also going to be a plus. A lot of what I learn is because I host and manage my own personal stuff.
  4. I didn't want to have to customize much of anything, including the theme. It needed to look good right out of the box.
  5. It couldn't be based in PHP. I hate PHP. With a passion. Probably because of WordPress....
  6. It needed to support comments on blog posts. (More on this)
  7. I didn't really want to spin up and run a MySQL server.

After a lot of hunting and searching it came down to 2. Joomla and Ghost.

Since I could run Ghost on Windows with NodeJS and it was easy to do and not use MySQL, I went with Ghost. Time will tell if it was a good choice, but over the past few days of migrating all of my blog posts, it's been nice. As for the backend database it can use SqlLite3 or MySQL. Since this is a pretty low traffic site I'm sticking with SqlLite. If I need to migrate to MySQL, I will.

The one thing I wish Ghost did that it doesn't is do comments natively. Unfortunately that is something that it does not do. Since this is a low traffic site I was able to use the free ad-free comment piece of Disqus. It was easy to do, implement and well documented at Disqus and on Ghost's website. So far I'm pretty pleased with the overall experience.

I can't believe how easy Ghost has been to use. It's straight forward and fast.

There is one gripe I have with the post UI. You can't type in the date of the post. You can't scroll through the day calendar by year either. And when you're migrating posts from 2010, thats 96 clicks for every post. I got bored with that real quick and learned SqlLite to manually change the date in the database. It's actually pretty easy. And because I hate typing alot, I used a simple select and used Excel to build my update statements for me, and pasted the resulting statements and it worked.

  1. Head over to SqlLite's site https://www.sqlite.org and download the sqllite-tools from the their download page.
  2. Extract the zip.
  3. Stop your Ghost site.
  4. Copy the database from the data directory to another folder on your local system. It's at <ghost directory>\content\data\ghost.db. I would store it at a simple spot, like c:\data\.
  5. I made a second copy as well and named it ghost.db.bak. That way if I blow something up I have a copy.
  6. Now you'll start sqllite3.exe from the extracted tools zip file.
  7. Type in .open c:/data/ghost.db. The forward slashes are important, it won't read the file if you use a backslash. Typical of Linux like applications
  8. Type in .excel <- this will open the results of the next command in excel
  9. Type in select id, slug, published_at from posts;
  10. Inside of excel you should now have 3 columns, the first is the Id, don't mess with that, the slug or the URL, and the date the post was published. You'll be updating the 3rd column.
  11. I added a 4th column, with the following formula ="update posts set posted_at='" & TEXT(C1, "YYYY-MM-DD HH:mm:ss") & "' where id='" & A1 &"';"
    Double click the lower right hand corner of that cell and it will auto populate the cells down to the bottom of your list.
  12. Update the date/time in the 3rd column for the posts.
  13. Copy the update commands into the SqlLite tool.
  14. Copy the database back to the original data folder
  15. Start your Ghost site.

It took about a day to convert all 60-ish posts from my old Orchard site to Ghost. There may have been a more automated way to do it, but spending that time on 60 posts didn't seem worth it. Spending time on the post date however, very worth it. During my migration I also cleaned things up. A lot. There were a lot of type-o's in there. And because I can now use Markdown and code formatting works nicely I also took care of that. This was all done pretty quickly so I'm sure I missed some stuff in the reformatting and cleanup. Hopefully the integrated spell checker helps with that.