Back to top
Migrating simplePHPblog to WordPress
Wed 24th Jan '07
I just migrated my blog from simplePHPblog to Wordpress. There was no option for sphpb in the Wordpress import wizard, so I used RSS, not without a hickup or 2 though...
First, I exported my blog to RSS by right clicking the 'get RSS2 feed' on my old blog. I saved the file blog.xml on my desktop.
Then I used the Wordpress RSS importer and selected the file from my desktop and away it went. I got a message saying 70 odd post had been imported. But when I looked at the entries, they were all empty! The title and subject were there but the content itself was not there... bugger!
A quick look in the MySQL database used by wordpress found the issue. In the table wp_posts, every imported entry had the tag <![CDATA[ in it, at the beginning, and then ]]> at the end. This definately had to go! This tag is used in XML files, to tell the parser to not look inside this section for any tags. But it breaks a web browser - it ignores everything in between!
My first instinct was to google the problem, and I found some people were using a text editor to remove these tags from the XML file before importing. I was worried this would break my XML, and as it turned out, it did. The file would no longer parse properly, because there were html tags inside the areas which the CDATA tag was previously protecting. So the import would only work with the CDATA tags in place, I figured.
So i decided the solution was to simply strip the tags out of the entries in the database directly. I ran the following 2 queries:
update `wp_posts` set post_content = replace (post_content, "<![CDATA[", "");
and
update `wp_posts` set post_content = replace (post_content, "]]>", "");
which effectively removed any occurrence of those two strings from the entries, and presto! I used the same method the redirect links in posts which pointed to my old gallery on mxm to my new gallery at gallery.itriver.com.au as well.
Last issue was that the categories created were a little messy. Any items which used to belong in several categories (say Family, Photos, and music) created a new category, like "Family Photos Music". I just used wordpress to delete these categories.
Otherwise, all seems pretty good.