
A general trend in my techno-lifestyle has been the move from do-it-myself, to FREE services. Take my email for example. I used to refuse to use Hotmail or Yahoo! because I didn't trust my communications to some company, and I wanted to use Imap. Along came gmail, and suddenly I could get tons of space, and an awesome client for free. Bye-bye exim and bye-bye Thunderbird. What about storing my photos online? No way was I going to put all my personal photos on some company's servers. Then Flickr began offering Unlimited storage at an amazingly low price, and their software made sharing a joy. Bye-bye jigl and my ever increasing storage woes. I guess what is driving my adoption of these services is the maturity they have achieved. Ajax makes the interfaces useable and with prices hovering just above free nothing else makes any sense.
So I recently realized that I was really not using my virtual server anymore. Google gives you free subversion repositories, free email, and free blogs. So the time had come to kill my server and the only thing standing in my way was migrating my blog from wordpress to blogger. It turns out this is not a straightforward thing to do.
Step 1: see if anyone else had done it. Of course others have done it, but there is no automatic solution (that works). There are dozens of how to documents on moving from blogger to wordpress, but I found only 1 useful for doing the opposite. It also came with a pretty well made Java tool. Here is a link to the tool. Too bad it errored out when I tried migrating my blog. It wasn't open source either so I couldn't try to fix it. I think it is designed to move a wordpress.com blog, not a standalone hosted instance of wordpress. In any case after fiddling with it for half an hour I thought I had better start rolling my own solution.
Step 2: I used mysqldump to grab my WP database from my server and then imported it into a local mysql database.
Step 3: I downloaded the python version of Google Blogger API and used it to create a few dummy posts and comments.
Step 4: I wrote a python script and migrated my entire blog comments and all in about 20 seconds.
Lessons learned:
- The Blogger API wasn't intended for migrations. You can't set the author of the comments programmatically. They belong to the person you login as. You can't backdate comments, so they appear anachronistic on the site. This is too bad, because there were some interesting folks who had left me comments. I would have liked to preserve that history.
- Python is a nice language, but I hate, hate, hate the whitespace sensitive nature of it. I also find it a bit less elegant than Ruby. Google, you need to stop pretending that Python is so great and get your API out there in Ruby.
- I'm never going to use this code again, thus it ain't very reuseable. My unit tests depend on my specific wordpress database. Stuff is just hardcoded in. I totally ripped off some of the sample code that came with the api download. For what it is worth I threw it up on my google code site. Feel free to check it out. It would be easy to make it better, but I don't want to mess with it.
10 comments:
Hi - I've imported all my comments and posts from my wordpress blog to one on blogger, but...
How do I do an overall redirect from wordpress to blogger? Does a 301 redirect work or do I need to do something else (and if it's something else, how??)
Thank you!
Here is the link I used to setup the blogger to use my custom domain name. They have some pretty decent info on their site. http://help.blogger.com/bin/answer.py?hl=en&answer=55373 As for redirects, do you mean redirecting for individual posts so that people linking to you don't have to change bookmarks? I didn't redirect any links, but since my domain name didn't change I figured people could still find what they were looking for with minimal inconvenience. So short answer is that I didn't do any redirect. If you are changing your domain name you can probably setup redirects with your domain name provider.
Has anyone tried exporting their hosted wordpress blog, importing it to wordpress.com, then running the java tool to import to blogger.
I can convert from wordpress to blogger. The posts are more or less 2000 and comments are more or less 4000.
Can you help me? I don't find your code in the google code repository.
Thank you very much!
innovatel,
look closer. if you click the "source" tab and then the browse link the code is under the trunk folder, although you should just check it out with subversion anyway.
I happen to love love love python's whitespaces. :)
And Google isn't pretending that it's so great because it really is great.
I guess it's a matter of preference though. So I'll stop now to avoid a flame war.
Hi cuberick
I need someone's help to move my posts from wodpress to blogger. I have already got the export file but it can't be converted.
I don't know much about python and other stuff which technical. I need your help if you can convert my wordpress file to blogger.
The file is attached in this e-mail and its is Farsi language that contain all my writing for 6 years.
Let me know if you can help me with that.
thanks
nasim
hi..
i'm trying to export all my posts from wordpress to blogger but i'm not so into this technical way of sorting things out.
do you mind to provide me with a step by step directions? it's great if you could help me. thanks.
move complete ...
goodbye wordpress ...
hello blogger ...
lets see how this goes ... :)
Hi I am Aaqil
From Pakistan.
I have spent more than three years in testing wordpress, wordpress.org, jigsy.com
I have moved wordpress.org to blogspot. New blogspot is much better than before.
In wordpress.org i hated, server fees, hosting issues, hosting resources issues, hacking attacks, wordpress.org broken or outdated codes/themes/plugins.
And in wordpress.org i could never find such good stable and free mobile template which is present in blogspot.
My blogspot blog is http://aaqilx.blogspot.com and I am feel much better now.
Post a Comment