Migrating from wordpress.com to .org – feeds and stats

This is probably the most interesting area of the whole move, and the one I’ve spent most time getting right.

One of the things I did like about wordpress.com was the statistics it showed you under the dashboard. They were quite comprehensive and also addictive. The feed stats on the other hand were not so good. I experimented with using FeedBurner, but as you have no control over the default feeds wordpress.com generates all you can do is add a link on the blog pages and hope people use it.

It is quite a shock when the stats tab disappears once you move to a self-hosted wordpress.org blog. As such, the general way people compensate is to use two external pieces of technology to provide much the same (and more) information:

FeedBurner

I’m not going to cover the process of obtaining a FeebBurner feed as that is well known and documented. However it is worth covering what you have to do to the blog to make sure people end up using it.

The first step is to use a plugin. I installed the FeedBurner Feed Replacement plugin. This will substitute the standard wordpress feed for your feedburner one whenever anybody clicks on the feed icon in the browser, or on the feeds under the Meta section.

However, there are still two possible ways that people can get to the original wordpress feeds. Firstly, they can copy and paste the links under the Meta section into their feed reader. The feed links that appear here are controlled by the PHP get_bloginfo() function. To modify what gets displayed, I went into the Theme Editor section under Presentation and edited the Sidebar theme file which originally looked like:


<?php wp_register(); ?>
<?php wp_loginout(); ?>
<a href="feed:<?php bloginfo('rss2_url'); ?>" title="<?php _e('Syndicate this site using RSS'); ?>"><?php _e('<abbr title="Really Simple Syndication">RSS</abbr>'); ?></a>
<a href="feed:<?php bloginfo('comments_rss2_url'); ?>" title="<?php _e('The latest comments to all posts in RSS'); ?>"><?php _e('Comments <abbr title="Really Simple Syndication">RSS</abbr>'); ?></a>
<a href="http://validator.w3.org/check/referer" title="<?php _e('This page validates as XHTML 1.0 Transitional'); ?>"><?php _e('Valid <abbr title="eXtensible HyperText Markup Language">XHTML</abbr>'); ?></a>
<?php wp_meta(); ?>

The interesting lines here are the ones that contain calls to get_bloginfo such as:

feed:<?php bloginfo('rss2_url'); ?>

I simply modified these lines to hardcode in the FeedBurner URLs for my main and comment feeds. However, if you are using widgets, then this does not affect the Meta widget and I’ve not yet tried to work out what needs to happen there.

The final way in which people may get to the original feeds instead of your Feedburner ones is via a feature called feed autodiscovery. This allows people to put in the site hostname (e.g. just http://www.adrianspender.com) into their feed reader and the reader then goes off to discover the correct feed URL. This will return the wordpress feed by default. To modify this, I went into my theme and edited the Header theme file in much the same way as for the Meta section. The difference this time is that there are three hrefs, each for different flavours of RSS and Atom feeds for the main site, not for comments. Simply replace the get_bloginfo() calls as before with your FeedBurner feed URL. I suggest you ensure your FeedBurner feed has the SmartFeed capability enabled.

Google Analytics

Analytics allows you to register your site with Google who will then provide you with very detailed site statistics. In order to do this, each page on the site needs to have a small piece of Javascript inserted into it. This contains your unique site key which is fed back to Google on each page visit.

For a dynamically generated site like a blog, this can be troublesome. However thankfully there are a number of plugins out there to help you. The one I used is called Ultimate Google Analytics. This automatically inserts the tracking Javascript into your blog pages and is configurable in a variety of ways to help you make sense of the stats.

Providing a dashboard stats view

Finally, there is a plugin called WordPress Reports which can collate your GA and FB stats into a single view within the wordpress admin, not too dissimilar to that provided by wordpress.com. It doesn’t look anywhere as good, nor give you as much detail, but may be useful nonetheless.

Migrating from wordpress.com to .org – customisation

I’ll cover the customisation I did to the new blog in the context of two areas: templates/themes and plugins/widgets.

Templates/themes

In wordpress.org, adding a new template is simply a case of finding one, downloading it, then uploading it to the wp-content/themes directory. It is then immediately available under the Presentation option in admin.

There’s not really much else to say other than I went here to look for themes. And here to read up on them. Of course, there are many, many more available than you get on wordpress.com and you have full control of their customisation without having to pay to edit the CSS! Look out for themes that support widgets if you are used to using them.

Plugins/Widgets

Widgets are pretty big on wordpress.com blogs, and the good news is that they are supported on wordpress.org as well, that is as long as the theme you are using supports them. There are also a lot more available. There is a list of widget aware themes and third party widgets here.

Widgets are delivered as plugins which are simply uploaded into the wp-content/plugins directory. You then have to go to the plugins tab in admin to activate them. You will want to activate the Sidebar Widgets plugin whilst you are there.

You should then see the Sidebar widgets option under the presentation tab as you are used to in wordpress.com.

It is worth noting that the Askimet comment spam plugin is available as part of the 2.1 package. However to enable it you need a wordpress.com API key. As you are reading this you are probably moving from wordpress.com so handily you already have one. Just go to Users then Your Profile on your old blog and you should see the API key listed. There’s also a Google seach and del.icio.us widget present by default.

The only other plugins/widgets I’ve installed so far are covered in the next post about feeds and stats.

Migrating from wordpress.com to .org – data migration

This post covers the my experiences of data migration from wordpress.com to a self-hosted wordpress.org blog.

WordPress supports a customised RSS based XML format known as WordPress eXtended RSS (WXR) for exporting and importing content from wordpress blogs. It also supports import from a number of other blog platforms, as covered in great detail on the wordpress codex entry.

The WXR file will contain all your posts, comments, categories and custom fields. It won’t contain your blogroll.

On the wordpress.com blog the manage option on the dashboard has an export option. From here you can generate the WXR file for import into the new blog. However, before you do, be sure to go in and delete any spam comments that Askimet has hanging around. There’s no point in transferring them and doing so just increases the size of the WXR file. I forgot to do this first time around, and ran into a PHP error which I suspect was caused by excessive attempts to allocate memory when importing. Re-exporting without the spam comments solved it.

Importing is just a case of going to the admin, manage, import option on the new blog and browsing to the WXR file.

My posts on the old blog were all made by a user with the name “Adrian Spender” and userid aspender. On the new blog the userid was admin. On importing this didn’t appear to cause any problems. However it did mean that new posts appeared to be from a different user to the migrated ones. To solve this I created a new user with the same name (but as it happens a different userid) I’d suggest that before importing you create the same userid/user name user on the new blog as was on the old, and give them administrator access. I suspect this might have got around the issue I then hit.

Looking at the imported entries, and comments or pingbacks I’d made had my name linked back to the old .com blog. I had to go through and edit each comment to update the link to the new blog address to avoid inadvertantly redirecting people back to the old blog if they happened to read old comments.

The final step was to migrate over the blogroll. WordPress has a nice facility to import a blogroll from an OPML file, but unfortunately there doesn’t appear to be the equivalent export capability (at least not on wordpress.com) Thus, and as I only had a short blogroll I did it manually. If all your blogroll links happen to be in del.icio.us for example then you could create an OPML from there.

I hit the same PHP memory error when the default wordpress.org template tried to display any blogroll entry. Initially I thought this might be because I had too many, but it then happened when I pared my blogroll down to just one entry. I got around it through the subject of my next post, namely changing the template.

Migrating from wordpress.com to .org – hosting and install

I was planning to write this anyway, but Andy has prompted me to do it whilst the memory is fresh. Probably a good job as it was so easy I never had to write anything down. I’ll attempt to document it in chronological order and bring up any issues I faced as well as resources I referred to. I’ll cover the following topics in a series of posts:

  • Hosting and blog install
  • Migration
  • Customisation
  • Feeds and stats
  • Diversion strategy
  • Summary / things to do

Choosing a hosting provider

Well this wasn’t too tough. I’d heard a lot of good things about Register1.net and their Technical Director happens to frequent an online forum I visit. The only option was which package to go for. I decided to go for the VDS Pro account because of the bundled in extra features including WordPress, but I’ll come onto why that was probably an unnecessary expense.

I also registered new domains with them at the same time. This simplified and sped up the process dramatically as there were no transfers to deal with. My domains and hosting were provisioned well within an hour of ordering. I decided to bite the bullet and get .com, .net, .org, .co.uk in one go as it is common for the others to get registered by others if the original domain gets so much as noticed. In fact I also grabbed aidyspender.com, co.uk, .net and .org as well, but two of those were already with another provider and need to be moved once they are about to expire.

Access to hosting and facilities.

With my hosting, no shell access via ssh or telnet is allowed for security reasons, leaving a web interface or more usefully ftp as the main options for getting content onto the site. The VDS is hosted on Redhat Enterprise Linux, and is managed through a web interface. It is running Apache 2.0, POP3/IMAP/sendmail/virus/spam, squirrelmail, PHP 4.3.9, Perl, MyPHP 4.1.18, phpMyAdmin, analog and webalizer.

Installing wordpress.org

As mentioned, the package comes with a 1-click installation option for wordpress.org. However on inspection it was fairly back-level (1.5.1.3) compared to the current version 2.1. On reading up about the requirements I discovered that my levels of PHP and MySQL were fine for 2.1.

I then read the installation instructions, and decided it didn’t seem to much hassle to install 2.1 myself. I followed the detailed instructions which involve:

  1. Downloading and extracting the package locally.
  2. Create the database. The installation documents how to do this through phpMyAdmin. However my host doesn’t give me access to create databases explicitly through phpMyAdmin. It has to be done through their hosting web interface (I guess so they can impose limits) but this was straightforward enough. You don’t need to create any tables, or go near any SQL. You need to make a note of the database name, userid, password and hostname (usually localhost)
  3. The next step is to edit one file in the wordpress package. wp-config.php has a section which needs to be updated to reflect the database settings.
  4. Upload the files via ftp. As it is all PHP it just needs uploading to the server like any web page. No shell access is required to install. The only decision to make is where to install it. I chose to put it under the /blog directory instead of in the root of my web space so I could maintain my own index page. However wordpress itself can give you the option to have a static index page which it manages within its own CMS. I’m still happy I went with the subdir though.
  5. Run the install script, simply by loading it in your browser. It takes less than 30 seconds and asks you for the name of the blog and your email address. After that your blog is up and running!

So now I had a blog with the default theme, and the usual wordpress admin via /wp-admin. One thing that is noticeably missing is the blue header bar you get on wordpress.com with a link to the dashboard. You suddenly realise why the meta section of the template has a Site Admin entry! The admin is missing a few things you are used to on .com, notably widgets, blog stats and a few other things, but I’ll get to all that in another post. At this point the shell of my new blog was up and running.

Grand website plans

As well as providing a home for this blog, I have other plans for my new hosted space.

Obviously as a software engineer writing middleware software at IBM I spend my working day designing and developing Java. However, like most, I’ve not been able to ignore the huge amount of Web 2.0 stuff using PHP, Javascript, REST, JSON, AJAX, Rails and more. Combined with the number of APIs out there from the likes of flickr, Google, Amazon, Yahoo etc. then it is no surprise that the age of the situation application has arrived. I’ve had a bit of an introduction to some of these technologies through some work I’ve been doing over the past six months or so, but it is time to really start to educate myself.

As such I plan to use this site to start playing with this stuff, outside of the direct work environment. I have a few ideas for what I’m going to do, and REST, JSON and the flickr APIs are top of the list to start with.

For the time being, there is a rather static index page at http://www.adrianspender.com which was very quickly created using the iWeb application that ships as part of the iLife suite on Macs. All it does at the moment is link to flickr and this blog, but as I progress I’ll add links to the stuff I’m doing, as well as blogging about them here of course.

So to anybody who has made it over from the old blog, this post is my statement of intent. I’m writing this to make sure I make the time to do this stuff and you can hold me to account. I have a terrible habit of garnering huge initial enthusiasm for tasks like this which then fall by the wayside. So if you don’t see some cool stuff appearing here soon, give me a gentle nudge! If I don’t do it then I might as well have stayed at wordpress.com

Adobe Lightroom preorder

As Andy has blogged, Adobe Lightroom 1.0 is now available for pre-order. As a big user of the beta I’m definitely going to get it, so I popped along to the Adobe online store. The UK promo price including VAT is £146.88. For this they ship you a box, CD and manual. However, there is also a download option via which you can simply download the software on purchase (or release day I guess) This allows you to re-download should you have to. Nice.

The thing I find baffling though is that the cost of the download option is £151.25. Why more expensive?

Update: Taking the boxed version through to checkout adds a shipping fee of £5.11 making a total of £152.88 including VAT. So for saving them any variable costs incurred in sending you a box you save the princely sum of £1.63

Update 2: After order completion it lists the estimated shipment date as 20th February.

I’m LinkedIn

I’ve finally got around to adding myself to LinkedIn. Some of you might have seen a connection request from me. I’m already suprised by how many people I know are on there, I’ve obviously been missing out on this for a while. If you read this and you know me, please feel free to connect to me. Here’s my profile, or you can click the button in my new Funky Buttons section on the right hand side ;-)

Yahoo Labs WorldExplorer mashup

The O’Reilly Radar have discussed the new World Explorer mash-up created by the folks at Yahoo’s Berkely research lab. It takes publicly geotagged photos from flickr and combines them with Yahoo Maps to create a mash-up from which you can view photos associated with a particular surrounding. It has some algorithm to display tags relevant to a particular area. What’s more, there is also a night option which will only show tagged photos taken at night to give you a different perspective.

You can embed the maps into web pages, blogs etc. via a nifty little flash app generator called Badger. Unfortunately, WordPress.com doesn’t seem to be happy with the embedded object HTML so I guess we will have to wait for them to do a similar thing as they’ve done for YouTube and Google videos, hint, hint ;-)

The underlying technology from Yahoo is called TagMaps, and it supports APIs to allow you to create your own tag maps from data you provide via a REST interface.  I’ve been playing with Google Maps and its APIs quite a bit over the last few months, but I’m getting more and more impressed with the functionality of the Yahoo stuff and am keen to have a play.

WebSphere ESB 6.0.2 released

WebSphere ESB 6.0.2 (along with WebSphere Process Server 6.0.2 and WebSphere Integration Developer 6.0.2) is now generally available. Existing customers can learn how to download the product from Passport Advantage here (just click on the link for the platform you require.) I’ve discussed some of the new functionality on this blog before, but you can now also access the Infocenter documentation, including a section on what’s new.