Sunday 23 November 2008

10 blogs from greatness

how to migrate a WordPress blog to Django

There is currently no utility to migrate existing blog content to django.

However, conversion of an existing WordPress blog is pretty straightforward.

Firstly, simply export the following tables from the WordPress database using phpMyAdmin

  • wp_posts
  • wp_comments
  • wp_terms
  • wp_term_taxonomy
  • wp_term_relationships

Import the tables into the django database.

Then run the following SQL statements which migrate posts, comments and categories and assume a WordPress 2.3 schema and a blank django blog. If you have already created content in django, minor changes will be needed. My WordPress blog only uses categories which simply get converted to django tags.

insert into blog_post
(id,
slug,
title,
pubdate,
moddate,
body,
draft,
closed)
select
wp_posts.id,
wp_posts.post_name,
wp_posts.post_title,
wp_posts.post_date_gmt,
wp_posts.post_modified_gmt,
wp_posts.post_content,
0,
0
from wp_posts
and post_type = 'post';

insert into comments_freecomment
(id,
content_type_id,
comment,
object_id,
person_name,
submit_date,
is_public,
ip_address,
approved,
site_id)
select
wp_comments.comment_id,
14,
wp_comments.comment_content,
wp_comments.comment_post_id,
wp_comments.comment_author,
wp_comments.comment_date_gmt,
1,
wp_comments.comment_author_ip,
wp_comments.comment_approved,
1
from wp_comments
where comment_approved = '1';

insert into blog_tag
(slug,
title,
description)
select
wp_terms.slug,
wp_terms.name,
wp_terms.name
from wp_terms;

insert into blog_post_tags
(post_id,
tag_id)
select
wp_term_relationships.object_id,
wp_terms.name
from wp_term_relationships, wp_term_taxonomy, wp_terms
where wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id
and wp_term_taxonomy.term_id = wp_terms.term_id;

Finally, delete the WP_* tables from the django (and not the WordPress) database.

WordPress 2.3 and Typo

I have upgraded this blog to the recently released WordPress 2.3. However, I have deep rooted concerns that the new tagging functionality will simply overload my tiny brain. The WordPress upgrade went smoothly enough although the editor now reports a missing table (wp_post2cat) which is slightly irritating. Also, I sense increasing disquiet amongst some long standing, intelligent and loyal WordPress users so I took the precaution of installing YABP (Yet Another Blog Platform). Please put your hands together and welcome Typo (powered by a delightful lady called 'Ruby on Rails'). Update: The Google Sitemap Generator plug-in was causing the error. The problem is resolved in the latest version.

how to create perfect tables in WordPress

Create tables, resize, add rows and columns, preview the output and add the finishing touches in Google Docs. Then simply paste the HTML into the WordPress WYSIYG editor.

blogging trends

Blog Trends

WordPress versus Blogger versus TypePad (according to Google Trends).

Note the slight skew for news items about Blogger.

Welcome to WordPress 2.2

I don't know what I did wrong but I just upgraded to WordPress 2.2 and everything still works.
  • Download WordPress 2.2 distribution and read instructions.
  • Upload tar archive to Bluehost using pscp.
  • Run manual database backup using AutoMySQLBackup.
  • Deactivate all plugins.
  • $ cp -rv blog blog-213
  • $ rm -fr blog
  • $ tar zxvf ~/wordpress-2.2.tar.gz
  • $ mv wordpress blog
  • Overlay contents of original wp-content/plugins and wp-content/themes directories.
  • Reactivate all plugins (apart from widgets) which is now in core.
  • Check version number (2.2) from dashboard.
  • Manually delete 143 spam comments that appeared during the 4 minutes Akismet's shields were down.
  • Admire new full screen WYSIWYG preview post.
Page: ← Previous  1 2 3 4 … 13 Next →