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.
last django in London
The problem with installing typo is that, during the research for hints and tips to get the software installed, configured and running on a shared server environment at Bluehost, you Google across like-mindedWordPress 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.
a rush of blood
I'm not normally a sucker for these free, pyramid style, link exchange schemes to drive more traffic to your blog but as simply everyone is not just talking about it but actually doing it, I thought I'd better add BlogRush to this blog.
Now, I must hurry into town and join the lengthy queues at Northern Rock to withdraw my 1 million pounds life savings. To be honest, I think this media fuelled panic is a little overblown and as I have a contrarian investing style, I have just purchased £5,000 worth of NRK shares at £3.10 waiting for the 'dead cat bounce'. The shares are currently trading at £2.93, £2.80, £2.69...
life and times of two 'A' listers
I like Robert Scoble. While I don't always agree with him and I have a love-hate relationship with his laugh, his blog is worth reading and he posts some varied and interesting videos but one thing is obvious.
The guy has a real passion for technology and writing. On occasions, he is subjected to vitriolic comments, hurtful criticism and abuse that is completely unjustified but he calmly takes it all in his stride and rarely retaliates.
Scoble is a family man and has a lovely wife. Indeed, he is a very lucky man. As I recall, my wife didn't have the forethought and love to buy me an expensive digital camera hours before she went into labour. Inevitably, Scoble will be posting live updates of his wife's lengthy and arduous labour via Twitter. I'm surprised he isn't live streaming the whole event.
Another 'A' lister recently admitted to hospital was Dave Winer. Unfortunately, Dave repeatedly broke rule two, regaling us all with updates on his state of health.
3 September - The saga begins...
'Had to take a break, I got a really bad cold, the flu, not sure what -- but it knocked me down. I had a fever, nasty cough, wheezing, and it was getting worse so fast that I went to the emergency room at a Berkeley hospital, where they gave me something to control the cough and help me sleep, and today I feel much better.'
6 September - Our hopes are briefly raised. Don't laugh. This is a disease !
'Yesterday was the first feel-good day after a horrible bout with whatever it was that hit me and dragged me under. But Naked Jen, who said she had the same disease, warned against believing you're better when you start feeling better.'
8 September - Our hopes are dashed but at least Dave received my email of support.
'I've gotten email from people who are concerned. Thanks for the concern. Yes, I have seen a doctor, even went to the hospital to get chest x-rays. I don't have pneumonia. Just a realllly bad cold. A monster proportioned cold. It attacks everything but my sense of humor.'9 September - My diagnosis is that this is not merely a heavy cold. This is a life threatening bout of man-flu.
'It's been a really interesting morning, in a sick kind of way (that is, I'm still really sick, coughing and wheezing, rasping and sneezing).'
10 September - Dave manages to summon the strength to type a blog post with no mention of his health.
11 September - A nation sighs with relief.
'Feeling much better today. Health is beginning to return. I owe it all to patience, lots of sleeping, drinking fluids, and not trying to be healthy before I actually am. Today I'm going to take a 20 minute easy walk in the sun.'Winer by name. Whiner by nature.