Rod Austin asked me in a comment how I've gone about this small application. This is my response. I'm reposting it here for your reference.

I'm doing it in C#, in a Windows Forms app on my local machine. My main reason for doing it this way is because I'm a professional C# developer, so it's much easier. Plus, I'm able to debug the application locally, which makes my life a lot easier there too. Once it's done, I'm sure it can be ported to any language, including PHP.

The basic principle I'm using is a bastardised ORM, where I loop through the folders, unzip and parse each file, and throw the (cleaned up) results into an entity that matches the WordPress table structure. Then (the bit I haven't done yet) I will save each WP entity (post and comments) into a WP database. I'm *probably* just going to generate a MySQL-compatible script instead, which can then be run manually.

I will make the code available as open source (probably the BSD licence or something similar), and then you can tinker with it. Since I'm only building it for myself, there are a few assumptions I've made in the code, and it isn't very robust. On the bright side, it's fast. I was able to unzip, parse and convert into entities all of my 850 posts in around 3 seconds.

As a final note, for about half a day's work, I'm impressed with how easy this has been so far. Granted, it would take about a day to finish it, and probably if I applied myself, the same amount of time to copy and paste every post into a WordPress engine anyway. That's not the point, though 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *