Why I switched from BlogEngine.NET to Ghost PRO
This is my first post on this brand new blog hosted on Ghost and I’m really enjoying this new experience 🙂
Mục Lục
A little bit of history
I’m a blogger from 2004. My first blog was a custom ASP.NET 1.0 application I wrote by myself for deep learning that Microsoft technology and, trust me, it sucked. Then I changed it so many times that I became a ninja of C# and ASP.NET.
After 10 years I decided to move to a built-in blogging platform, mainly because I wanted to leave behind all the time used for updating and maintaining the code of my blog, so I chose BlogEngine.NET hosted on Azure.
For keeping my old URLs and also for having a new visual theme, I decided to customize the platform and which was the result? I had a new custom application to maintain 🙂
Hello ghost!
After some years I knew ghost. “It looks good” I said by myself, looking from the outside of a blog. Then I discovered its features and… wow, it was really a love at first sight.
These are the functionalities that I really love of this platform:
- It’s extremely fast
- It’s open source and can be installed everywhere, but the Ghost Pro offer was exactly what I was looking for! A really “blog as a service” platform, with no worries about hosting, performances, upgrades and so on…
- Without any nodejs knowledge, you can do everything you need
- With a super simple redirect and routing mechanism, you can redirect old URLs to new ones, handle more that one collection of posts (based on the type of contents) and build a multilanguage site with no worries
- There are a good bunch of starter themes
But the main feature that impressed me is the editor. It gives you the ability to think about your content and anything else.
Migrating from BlogEngine.NET to Ghost
The migration process was really easy. Here the steps I followed:
- I downloaded the BlogML file from BlogEngine.NET admin area
- I downloaded this project from Github, to convert the BlogML format to Ghost JSON file (I changed some lines of code for keeping my original tags and adding the tag for localization)
- I imported the JSON file from Ghost pro administration area
- I sent a .zip file to Ghost Pro support team, for importing it
- I configured redirects and routings
- I downloaded and customized the Royce theme from Ghost theme marketplace
In 2 or 3 days of work, my blog was again up and running.
The main change I needed to do to the import solution, was related to Ghost 2.0 new import specifications. If you want to import HTML content (like me) you now need to prepare a “mobiledoc” property in your JSON file before importing. You can find info about this new property inside the documentation.
Here the code I wrote for handling this change.
var mobiledocObj = new {
version = "0.3.1",
markups = new object[0],
atoms = new object[0],
cards = new object[1] { new object[2] { "html", new { cardname = "html", html = string.Format("<p>{0}</p>", postContent) } } },
sections = new object[1] { new object[2] {10, 0} }
};
var mobiledocStr = JsonConvert.SerializeObject(mobiledocObj, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Include });
A super support
I had more than 900 posts, written in Italian, that I decided to migrate in Ghost Pro and my primary goal was to keep URLs working from my previous platform.
How I did it? The Ghost support did this job for me, and I’m still amazed about their availability for supporting this need.
The main problem I had was related to addresses with .aspx extension, that normally is not handled by Ghost Pro platform. The support team was so kind to configure the redirect only for my domain.