So I’ve had WordPress installed for all of a week & then they go and release a new version on me. Sigh.
Anyway, I figure if I intend to keep up my web-nerd cred I’d better install it. So I’ve done that & I now need a way to import all my messages from this site to the new site. I’m not game enough to do the direct upgrade thing that’s descibed, I wanted a parrallel cut-over. That’s when I discovered one thing really lacking in WordPress: There is no export function.
WordPress has plenty of good scripts for importing posts & comments from other platforms, but nothing to go from one copy of wordpress to another, specifically from one version of wordpress to another. The upgrade instructions show you how to change your current blog from 1.x to 1.5, but not what to do if you want to have them both running at the same time.
In the end I had to do it by doing a DB dump and running the SQL script on the new DB, but I still needed to hack that slightly to get it to work. There are 4 tables that contain the information about the posts & comments: wp_categories, wp_comments, wp_post2cat, wp_postmeta & wp_posts. The only structural change as far as I can see is the removal of the ICBM data (i.e. the post_lat & post_lon fields) from the wp_post table. As it was far easier to modify the 1.5 database than to get the export script to exclude those fields, I just added those two fields to the wp_post table, ran the script then dropped the fields. See, easy!
This was way to fiddly for your average joe-user, there really needs to be a way to export all your posts & comments in a standard format that can be imported into other WordPress blogs and also into other platforms. If you do need to do this, here’s the code:
alter table wp_posts ADD COLUMN post_lat FLOAT(12,31) after post_excerpt;
alter table wp_posts ADD COLUMN post_lon FLOAT(12,31) after post_lat;
###INSERT STATEMENTS HERE####
alter table wp_posts drop column post_lat;
alter table wp_posts drop column post_lon;
###INSERT STATEMENTS HERE#### with the insert statements from the database backup (procedure is shown here) for the tables mentioned above.
So anyway, the long and the short of it is that we’re now running on 1.5
, and I haven’t changed anything yet. Time to start on a whole new template!