/ IT

Easy way to migrate your blog from Ghost to Wordpress

Ghost is a wonderful blog engine I'm now using for almost one year, and I'm not planning to use something else.
But, recently, I had to work on a personnal project based on Wordpress and I told myself :

« It's so easy to migrate from Wordpress to Ghost... but if I need/want to migrate from Ghost to Wordpress will it be easy too ? »
Short answer : No it's not ! But because I'm a Saint, I'll show you how !

Ghost Logo

1. Why migrating from Ghost to Wordpress is more difficult ?

Well...

  • First, for now Ghost is not as popular as Wordpress is, so there is a lack of "official" solutions available to do a smooth migration.
  • Second, Ghost export is done with JSON, which is awesome and most of all... modern. But Wordpress is handling XML, older, more messy.
  • Finally, Ghost structure is quite different from Wordpress and it's normal, but we need to adapt.

2. So... how can we proceed ?

At first, I told myself :

« Ok, I just need to translate my JSON to XML, and adapt fields using the Wordpress documentation»
« But... Ghost is using Markdown for posts ! I need a Wordpress Markdown plugin»
« XML is such a mess, it's easier to do a CSV using Google Refine and import the fields in Wordpress with a plugin...»
« Oh, headache is coming ! »

Fortunately for my sanity, I found a tool coded in Python named Ghost2WP, a simple but useful tool, based on the python-wordpress-xmlrpc module.
Ghost2WP will push directly your blog articles to Wordpress using the XMLRPC module built in Wordpress.

3. Command & Conquer !

You'll need :

  • Git

  • Python with additionnal modules :

    # pip install python-wordpress-xmlrpc
    # pip install python-dateutil
    

Easy part :

$ git clone https://github.com/eidmantas/ghost2wordpress-edit.git
$ cd ghost2wordpress-edit/

I suggest you to edit ghost2wp.py and add the path of your python interpreter :

$ whereis python
python: /usr/local/bin/python
$ vi ghost2wp.py
#! /usr/local/bin/python

Now, make sure to export your json file from Ghost to your ghost2wordpress-edit/ directory and edit the ghost2wp.py file :

$ vi ghost2wp.py
xmlrpc_endpoint = 'https://test.cagedmonster.net/xmlrpc.php'
username = 'cagedmonster'
password = 'somethingverysecureornot?!'
filename = 'cagedmonsters-blog.ghost.2017-09-12.json'

We make sure to be able to run the script :

$ chmod +x ./ghost2wp.py

Now, we just have to run our tool and check every post being uploaded to Wordpress :

$ ./ghost2wp.py
Uninstall Skype on Windows 10 Anniversary
Installation chiffrée d'OpenBSD 6.0
Déploiement d'un serveur httpd(8) sous OpenBSD 6.0 avec PHP/MYSQL/SSL et sécurisation via PacketFilter
Eggdrop et scripting TCL
OpenSMTPD sous OpenBSD 6.0 avec SSL/VirtualUsers/Dovecot
Notre place dans l'univers !
OpenSMTPD & Dovecot sous OpenBSD 6.0 avec support MySQL et SPAMD
Serveur HTTP/2 H2O sous FreeBSD 11 avec support PHP/MySQL
Bloquer le tracker T411 sous Linux
EvE-Online : 2016 best streamers
Contourner le loopback de la Livebox
Raspberry PI : Packet Filter install under FreeBSD
OpenBSD 6.0 - Configure your static IPv6 network
OpenBSD : httpd(8) and authentication with htpasswd
CagedMonster grows and evolves !
Deploy Ghost blogging platform under OpenBSD with nginx
Setup OpenBSD 6.1 with Full Disk Encryption
WoW Nostalrius Reborn
Setup SmokePing under OpenBSD with nginx and SSL
Avoid OS detection on OpenBSD
OpenBSD's httpd(8) server with PHP/MYSQL/SSL and PacketFilter firewalling
Stargate episodes timeline
Deploy Ghost under Raspbian with MySQL / nginx / Let's Encrypt / strong SSL
OpenSMTPD under OpenBSD with SSL/VirtualUsers/Dovecot
OpenSMTPD and Dovecot under OpenBSD with MySQL support and SPAMD
Setup a complete FreeBSD server environment on your Raspberry PI
Easy system monitoring with Cacti under OpenBSD and nginx
Build a fake SSH server under OpenBSD with PacketFilter and sshesame
Free Ghost Blog Platform hosting at CagedMonster.
Quick and secure Samba setup under FreeBSD
Secure your SSH server with blacklistd and PacketFilter under FreeBSD

Quick, and easy, we avoided a lot of tears !

CagedMonster

CagedMonster

« I know everyone I've been everywhere I know everything Because I'm everybody » Ether - Nothingface

Read More