This code sample is how I used R to query the data loaded into Mysql from the Wordpress backup, converted the html to markdown, and moved into a jekyll blog.
Depending on your provider, you should be able to access backup files of your MySQL database which contains the database for your blog. The files will be SQL files.
Using MySQL Workbench, create a database, activate it, using the following:
CREATE DATABASE blog;
USE blog;
In the workbench window, create a new script, and simply COPY/PASTE the contents of the SQL file into the new script. Run the script, and voila, you know have your blog within MySQL to query.
NOTE: I opened the SQL file from the backup in Sublime Text, and from there, just pasted into the new SQL file I opened in the Workbench. I couldnt get the restore feature to work, but c'est la vie. It was faster to copy/paste given this is one time thing.
It's very important to note that I couldn't automate this. I had a loop to
re-build my blog dynamically, but some posts had UTF-8
conversion issues. To get around those issues, I used the iconv
function.
For me, it was much easier to debug the conversion process post-by-post. I didn't have that many, so it was much faster and easier to iterate over each post as opposed to having a script that handled errors.
It was surprisingly easy to convert my blog from Wordpress into jekyll using my hosting provider's backup, MySQL, and R.