A quick cellphone snap for this Halloween, via the Instagram iPhone app.
Textpattern To WordPress Migration And Importer Updates
After many years on the Textpattern blogging platform, I’ve migrated Place Name Here over to WordPress. Though it only took a day or two to migrate blog posts and comments dating back to 2004 and create a theme to match, it was a move that needed some massaging.
Why Change?
I had been contemplating the change for some time now. I’ve used both systems, as well as others like Movable Type, for personal and client projects and have a good feel for each system’s strengths. I was seeing that where WP was headed is more aligned with where I think I want to take this site. It isn’t that there was anything wrong with Textpattern—in fact in many ways I still prefer it’s simplicity, template system and other core features. But that project seemed to have plateaud and contributions, updates and roadmaps are sometimes unclear. WordPress has continued to move forward and make easier some of the features I’ve been wanting to add (pingbacks, gravatars, other blogging and infrastructure fluff). But since these weren’t pressing needs, I just kept bumping the move until recently when I had the time to look at it again.
Data Importer Hiccups & Changes
Having a relatively simple markup structure to begin with for the old site’s templates made the theme transition relatively easy. By creating a child theme of Twenty Ten and editing just 9 of the files (along with a bit of experience) got me to what you see now. Given this is only a migration of a 2+ year old markup and CSS that’s been tweaked a few times too many there is certainly cleanup that needs to be done when I get a chance, but a redesign is another challenge for another day.
What I did have to wrestle with was the data migration. The current Textpattern importer plugin seemed a bit out of date and for my needs it needed a bit of customization. The requirements I laid out for a successful migration from Textpattern 4.2.0 to WordPress 3.0.1:
- Post author needed to remain my user account in both systems.
- Old permalinks needed to work, so
/article/[ID]/[textstub]needed to be configured and IDs in the old system needed to be preserved. - Tags needed to be migrated from the old system to the new.
- Post Body and Excerpt HTML fields needed to be imported so I didn’t have to configure Textile parsing for all old articles.
Items 1 and 2 required a little massaging before import.
- Create the WordPress admin user with the same username as the author in Textpattern.
- Delete all test posts, comments and pages from the MySQL database to free up any IDs.
Customization of the textpattern-importer plugin was required to make the rest happen. It wasn’t really a heavy job, but three changes needed to be made.
Swap the use of the Body and Excerpt containing Textile code with the “compiled” Body_html and Excerpt_html fields.
// Get Posts
return $txpdb->get_results('SELECT
ID,
Posted,
AuthorID,
LastMod,
Title,
Body_html,
Excerpt_html,
Category1,
Category2,
Status,
Keywords,
url_title,
comments_count
FROM '.$prefix.'textpattern
', ARRAY_A);
Include the Keywords field (was this just overlooked? I don’t understand why it wasn’t there already). Also, insert the existing ID for each inserted post (as import_id).
$ret_id = wp_insert_post(array(
'import_id' => $OldID,
'post_date' => $Posted,
'post_date_gmt' => $post_date_gmt,
'post_author' => $authorid,
'post_modified' => $LastMod,
'post_modified_gmt' => $post_modified_gmt,
'post_title' => $Title,
'post_content' => $Body,
'post_excerpt' => $Excerpt,
'post_status' => $post_status,
'post_name' => $url_title,
'tags_input' => $Keywords,
'comment_count' => $comments_count)
);
What To Do With The Code Now?
I feel the need to share, but is it worth submitting back to the project?
I’ve uploaded both my customized importer plugin and a diff incase anyone else should want to attempt to use it. Please read my requirements above before you do, but it will probably be a smoother transition than the current plugin. I’d love to discuss contributing the changes back into the project with someone, but wouldn’t lobby for it without some discussion of which of my requirements are universal enough to make it (keywords, yes, HTML posts, dunno). Please use the comments section to let me know your thoughts on contributing this code back to WordPress—or report back if you’ve used the code.
Download pnh-textpattern-importer.zip which contains:
- textpattern-importer.php: (replace contents of
/wp-content/plugins/textpattern-importer/textpattern-importer.phpwith this file after installing existing plugin) - textpattern-importer.php.diff
WordCamp NYC Photos And Links
Last Saturday I had the opportunity to attend “WordCamp NYC 2010”: on the Baruch College campus. The day started with a morning full of 5 minute lightning talks to help attendees choose which session to attend in the afternoon. I was up front taking photos of the speakers, photos are now up on flickr, and in this slideshow:
Session Roundups
In the afternoon, longer form presentations were given on a number of topics, from blogging, to academic use, and more technical topics. Here are some slide decks from some of the more interesting sessions—some I made it to and others I wish I did:
- Building a High Performance WordPress Environment by Matt Martz
- John Ford presented on Hardening Your WordPress Installation
- Sara Cannon introduced @font-face and other font embedding with Type in your WordPress Themes
- I don’t see slides up online, but check out the work at Universal Subtitles which Dean Jansen spoke about.
I think some of the sessions should be up on wordpress.tv at some point so keep an eye out for them.
The Book, It's Real!
The CSS Pocket Guide
Alternate Title: What I did on my Summer Work-cation
This blog has been a bit quiet the last few months—a direct result of spending all of my non-work hours writing my first book. The CSS Pocket Guide, the results of all that effort, was just sent off to the printers earlier this week and hits the bookstores on October 25.
Getting Here
At the beginning of the Summer a client of mine, and author of The HTML Pocket Guide, Bruce Hyslop approached me on behalf of Peachpit Press who was looking for an author for the next book in their Web Design Series. It meant resigning any hope I had for a bit downtime this Summer after a busy Spring that included teaching for the first time, but after meeting and talking with the team and talking things over with some previous authors I jumped on board. Indeed, it took more than a few long nights and much help by a tech editing tag team of Michael Bester and Kimberly Blessing along with Kim and Cliff at Peachpit to pull together. But in the end I think it was worth the effort and I hope it plays a part in helping a person or two learn about building web pages with web standards and modern development practices.
Between The Covers
The goal of The CSS Pocket Guide is to provide a novice or experienced front end developer an introduction to the fundamentals of CSS and then guide them through the building layouts grids, styling type and other typical web content. It also is intended to double as a CSS reference book—organized loosely based on the contents of CSS3 modules making it easy to look up details for individual properties like margin, float, border-radius, or @font-face.
Pre-order The CSS Pocket Guide
You can pre-order The CSS Pocket Guide, available late October 2010 at your favorite book store:
- Buy The CSS Pocket Guide at Amazon.com
- Buy The CSS Pocket Guide at BN.com
- Buy The CSS Pocket Guide at Peachpit
The CSS Pocket Guide will also be released as part of a boxed set along with The HTML Pocket Guide by Bruce Hyslop and The JavaScript Pocket Guide by Lenny Burdette available late November 2010:
- Buy The Web Design Pocket Guide Boxed Set at Amazon.com
- Buy The Web Design Pocket Guide Boxed Set at BN.com
- Buy The Web Design Pocket Guide Boxed Set at Peachpit
… And now it’s time for things to start returning to what passes for normal and getting back into the groove of more regular posts about making web sites and making pictures.




