WordPress on Google AppEngine and Migrating from BlogEngine.NET

In 2004 I started blogging on my own domain using discountasp.net as they offered a competitive hosting package based on Microsoft technology. Fast forward nearly a decade and I haven’t used Microsoft technology for nearly 5 years and maintaining my Blogengine.NET blog had become an increasing challenge. Upgrades were very difficult and I found myself stuck on a tweaked version that couldn’t have easily be upgraded. Recently, Google added support for PHP on Google Appengine and posted steps to get WordPress running so I applied for and got early access and I’ve been slowing migrating all of my content.

I’m writing this post prior to completing the migration as the number of steps involved has been growing and I figured it might be helpful to track what was required so I don’t forget and to share what I found. The list here is not exhaustive by any stretch and it’s likely written in such a way for me to remember than perhaps general utility though nonetheless here it is.
Once I got a basic install working which was rather straight forward I spent several days getting reacquainted with WordPress which I’d used many years go though only locally. Needless, to say it’s come a long way and with an iOS client on both the iPhone and iPad it looks really promising.

WordPress Plugins

  • Memcached plugin (and no this doesn’t activate!)
  • BlogML pluggin
  • Redirection plugin
  • Creative Commons
  • Google Analytics for WordPress
  • Adsense Explosion
  • Pushover Notifications

Importing My Blog Content

First was the task of researching tools to import BlogEngine.NET’s BlogML format for which I found a plugin. The plugin wasn’t just drop in and go and I ran into issues with it processing my BlogML.xml file which required manually editing the XML as well as finding and patching XPath.class.php to v1.148 as it was outdated in the sources I’d found.
I also had to patch function parse_blogml in blogml-importer.php to read my BlogML.xml file from my WordPress dedicated Google Cloud Storage bucket like this (and yes, figuring out this URL took a fair bit of Googling where wpsdt-blog-files refers to my Google Cloud Storage bucket):

$sXml = file_get_contents('gs://wpsdt-blog-files/BlogML.xml');

Next I found my BlogML.xml file was too large so I had to chunk it down into several different smaller files in order for the import to proceed a process which took a long time as AppEngine repeatedly timed out importing the .xml file though it eventually worked. Oh yes, it took quite a bit of trial and error to figure out the various file permissions that had to be granted to get access from a WordPress plugin to Google Cloud Storage including the fact that I found myself cursing Google’s new Cloud Console with buttons to change permissions that only appear once you check the bucket you want to change. Perhaps needless to say it would have been awful nice if they were just disabled so you at least you knew they existed.

Setting up Redirects

I exported BlogEngine.NET to BlogML.xml and extracted all post URL’s to build a CSV mapping to import into the Redirect plugin as WordPress and BlogEngine.NET don’t have compatible slugs. (I’m still manually correcting the dash “-” placement in over 600 slugs as no simple pattern would have worked).
Setup redirect for BlogEngine.NET dynamic image serving /blog/image.asx?picture=(.*) -> /AppData/files/\1
Setup redirect for blog archives /blog/Archives.aspx -> /blog/2013 (close enough)
Redirect BlogEngine.NET syndication link /blog/SyndicationService.asmx/GetRss -> /blog/feed
Fix up FeedBurner RSS source link /blog/feed
Set Site Address (URL) to /blog so I could continue to use appspot.com’s support for SSL for site administration without paying for an SSL cert on www.stevetrefethen.com and saving myself the cost of the cert and what looks like $9/month for SSL support on AppEngine.
Of course, I learned a hard lesson along the way by changing both the WordPress Address and Site Address URL’s in such a way that created an infinite redirect loop. To fix this I had to install Google’s CLI tools for accessing MySQL on Google Cloud SQL and manually update the wp_options table to correct my mistake.

School Blog Content

While I was working on the the Scotts Valley Parcel Tax effort I setup a secondary BlogEngine.NET install (before it supported multiple blogs) and all of that content had to be exported, imported, and redirected as well so repeat many of the above steps.

Wiki Content

I was a fan of ScrewTurn wiki and had been running a few installs of that as well so I moved a number of those pages here manually largely but cut/paste as there is/was not export/import available.

Handling Static Image Files

Over the years I’ve had various image files scattered around my site thus I had to copy these paths from my old site into the new WordPress install which included:

  • /files
  • /blog/AppData/files
  • /blog/images

Upload various media files to my WordPress Google Cloud Storage bucket.

Domain Name Transfer

I’d not done a domain name transfer before so this was my first such experience and while it all went smoothly the only problem was a very poorly written email from OpenSRS (whose website looks like it’s from the early 90’s) that mislead me thinking the transfer would occur after 7 days. The email read (emphasis mine):

If you wish to cancel the transfer, please contact us before Tue Nov 12 04:13:22 2013 by going to our website, <link removed>

Needless, to say I didn’t click the link until after the deadline passed only then to realize the link had a checkbox I needed to click and submit.
Years ago I’d gotten a Google Apps for Domains account for my Gmail hosted personal email address so once the domain was transferred I just needed to edit the zone file and get it pointed to my WordPress AppEngine project.

Missing Handler

After running into a few problems I found his issue with app.yaml

# 09/29/2013
# https://code.google.com/p/googleappengine/issues/detail?id=9972
# missing handler
- url: /wp-(.+).php
  script: wordpress/wp-\1.php
- url: /(.+)?/?
  script: wordpress/index.php

New Contact Form

After a bit of digging I found a plugin called Contact Form 7 which I’ve used to replace my old BlogEngine.NET contact form.


All in all I’d say this was a pretty damn painful process with a lot of trial & error that took me a few months of late evenings to get going. I’ve been blogging since June 2004 and accumulated an awful lot of cruft over the years that I simply didn’t remember which didn’t help.
The site has now been running for a few days and I’m in the process of trying to reduce the cost of running it on AppEngine as it’s currently over $2/day whereas discountASP.NET I was running about $20/month with SQL support. Just applied a few changes based on this post.
Found this post which I totally agree with.

[Updated: 12/15/2013] Added Contact form info
[Updated: 01/07/14] Updated Google AppEngine plugin to 1.2 running on 3.6.1