Technology

Migrating from WordPress to Ghost CMS

Looking for a CMS that could help me solve the technology problems that small and medium sized digital publishers have (at least in this region - Central and Eastern Europe) I stumbled upon Ghost CMS, an open source, adaptable platform aiming to power the modern online publications.

I decided to play with it for a while and see how it can serve my needs, and in the process I liked it quite a lot for its simplicity and beauty, but also for its performance and loading speed. Thus, I decided to try it out in a live environment to force myself to use it hands on because I believe that's how you best learn a new technology.

First, I manually (copy/pasted content) migrated my Romanian language blog from WordPress to Ghost and then I decided to try the official WordPress2Ghost migration plugin to migrate this blog and its about 150 posts, even though I was a bit worried by the fact that the plugin hasn't been updated in more than 2 years.

I followed the official Ghost documentation for this process and managed to migrate all the content from WordPress to Ghost, albeit with a few hiccups that I had to take care of with the help of Google search. I provided my feedback to the Ghost team and I've been positively impressed by their reaction and quick update of the documentation page to provide some of the details that I initially missed in my migration process.

I will not go through the details of installing Ghost, but you can check out the tutorials on the official Ghost support page (which is a bit confusing to navigate if you ask me, but once you get the hang of where the articles are, they are well inter-connected).

However, if you're not a techy person, I recommend you register for the 14 days trial (and test this migration process for yourself) and, if you like the Ghost digital publishing platform, use their hosted GhostPRO service.

So, assuming you already have a WordPress blog, just go ahead and install the Ghost export plugin as indicated in the Ghost migration tutorial. I have done this and managed to export and download my exported .json file without any issues.

Going through the file preparation steps, I realized I couldn't just simply replace "/wp-content/uploads/" with "/content/images/" as I had to cater for the escape characters needed for the special characters (such as "/") in the .json file as well.

Since the new Ghost installation and my former WordPress blog were on the same server, for me it was easy to just copy the image files from one folder to another with cp -Rv /path/to/wp-content/uploads/* /path/to/content/images/.

Since I already had the destination Ghost installation prepared I went into the Ghost admin interface, chose the Settings -> Labs menu option, chose the exported and prepared .json file and hit the Import button. After a few seconds, the WordPress blog posts were imported as stories into Ghost.

The main issue I ran into after the import was the problem or reassigning tags to stories, as Ghost has only a system of tags to categorize content, while WordPress uses both tags as well as standard content categories. I had to do some wizardry to delete all tags, something that's not recommended for you to try at home. For those who know a bit of SQL it involved this query: DELETE FROM tags WHERE id NOT IN (SELECT tag_id FROM posts_tags);.

Since there were several times more tags than stories, I decided to remove tags from each article and then use the above mentioned SQL query to bulk delete them (a feature that I hope Ghost CMS will implement in the near future to make this migration process easier for non technical users).

I then recreated the main categories within which I wanted to structure my content (to also use them as navigation menu) and reassigned stories to each one of them. However, since the WordPress structure was more complex (more categories there), I also had to import a .json redirect file to redirect former categories to the newer, more generic ones.

After solving the content import issues, I went on to buy a theme from the Ghost marketplace, installed it easily and then spent some more time fiddling with the theme files on the server (again, not a recommended activity, this should rather be done by downloading the theme, modifying it on your computer via a text editor and then uploading it again through the admin interface) to customize several aspects of it.

After a few hours of problem solving I finally had my new Ghost blog up and running. I hope that this will be a long and beautiful friendship :) as I plan to learn more about the platform and see if it can grow to become in the near future a better CMS than WordPress.

PS: Because I am a big fan of open source technology and I like to give back whenever I can, I spent a few minutes translating WorldCasper, the official international theme for Ghost CMS, by submitting a GitHub pull request, which was approved and incorporated into the official project.

Author image

About Daniel

Digital marketer with a solid background in technology.
  • Bucharest, Romania