Pebble Migration
In order to migrate this weblog from Pebble 2.2 to WordPress 2.3.3, I created a small, quick-and-dirty migration script. And in case anyone else might have use of it, I’m putting it here: pebble-wordpress.py, pebble-wordpress.xsl.
The script requires a Python installation (tested with version 2.5) with 4Suite. Once you have that, follow these steps:
- In Pebble, export your blog as a ZIP file (this is located under Utilities). Extract all files.
- In WordPress, manually create all categories and tags that you’re using in Pebble. Lists of these can be found under /blog/categories/ and /blog/tags/. One simple way of creating the categories and tags is to write a new post and add all categories and tags to it.
- Download the above files (pebble-wordpress.py and pebble-wordpress.xsl) into the same folder. Open pebble-wordpress.py in a text editor and modify the strings at the beginning of the script. If you have several WordPress users, also edit pebble-wordpress.xsl (modify the line beginning with post_author; set the correct user id). Further modifications to the XSL file are necessary if you do not use the default WordPress table names.
- Run pebble-wordpress.py.
- Import the newly created file named wordpress-sql.txt into your WordPress database.
I make no guarantees that this will work for your setup. The script does not take Pebble static pages into consideration as I haven’t used any such pages (if you have, feel free to modify the script and send your changes to me).
May 9th, 2008 at 1:12 am UTC
First, thanks for publishing this migration process. I’m trying to convert from Pebble 2.2 to Wordpress 2.5.1. Question, which version of 4Suite do I use. I tried 4Suite-1.0b1 on Fedora 8 using python 2.5 and I’m getting “empty package restriction” errors when trying to install 4Suite. Should I be using 4Suite or 4Suite-XML?
May 13th, 2008 at 6:33 am UTC
I’m using the latest stable release of 4Suite. Perhaps you could try that version instead. I believe the correct package for Fedora is python-4Suite-XML. Hope this helps.
July 7th, 2008 at 12:02 am UTC
Thanks, that did it. I was able to install python-4Suite-XML using yum:
yum install python-4Suite-XML.
BTW, I did find a bug in pebble-wordpress.xsl. There was a missing semicolon at the end of the comments section and there was no update to the number of comments per post.
Here is the fix for the missing semicolon (i.e., see semicolon at end of comment_approved):
comment_approved=”10″;
And here is a fix which adds comment_count to a post (place at the end of the template after comments):
0″>
UPDATE wp_posts SET comment_count= WHERE post_name=”";
Also, since I installed wordpress following their “Famous five minute install”, I kept the admin account and then added my account. The meant that I had a user ID=2, which I set in pebble-wordpress.xsl as post_author=2.
Finally, as a side note to new users of Wordpress, you will have to copy the contents of the pebble ./image directory over to the wordpress directory where it is installed. For example, if you set img_url in pebble-wordpress.py to be:
img_url = ‘http://www.myblog.com/blog/images/’
then under the wordpress directory on your web server you’ll need to create the dirs blog/images and copy all images to this location.
- JA
July 7th, 2008 at 12:12 am UTC
The last post got munged. Guess you do not allow html/xml in a post. I’ll repost just the fixes using formated html — i.e., < and >
Fix for the missing semicolon:
comment_approved=”<xsl:if test=”state=’approved’”>1</xsl:if><xsl:if test=”state!=’approved’”>0</xsl:if>”;
Fix which adds comment_count to a post (place at the end of the template after comments):
<xsl:if test=”count(comment)>0″>
UPDATE wp_posts SET comment_count=<xsl:value-of select=”count(comment)”/> WHERE post_name=”<xsl:value-of select=”$postname” />”;
</xsl:if>
I hope that fixed the prior comment.
- JA