yichao firstname, zeaster nickname, zhang lastname

A tool that import all posts from wordpress to blogger in python

the tool can be downloaded from
http://yichao.zhang.googlepages.com/wordpress2blogger.py

Readme:

1 set the following parameters in the wordpress2blogger.py file
# set your wordpress username, password, xmlrpc url    
wp_username = 'admin'  
wp_passwd = 'mypwd'
wp_url = 'http://localhost/wordpress/xmlrpc.php'
                       
# set your blogger email, password, blogid
# blogid is in your blogspot Dashboard url, for example:
# http://www2.blogger.com/posts.g?blogID=18083698, "18083698" is your blogid.
blogger_email = 'yichao.zhang@gmail.com'
blogger_passwd = 'mypwd'
blogger_blogid = '18083698'

# set how many recent posts do you want to import from wordpress to blogger
wp_recent_posts_num = 5 

# set debug mode = True if you want to get debug info
DEBUG = True

3 make sure python in your path

4 in terminal, type the following command
   "python wordpress2blogger.py"

16 comments:

Ryszard Szopa said...

Works great! Thanks!

(Though it would be even nicer if it could remember which posts have already been fetched and skip them when executed once again (e.g. after a 101 error or smth).)

zeaster said...

see this post:
my latest version meets your needs.
http://zeaster.blogspot.com/2007/02/blogsync-with-gui-coming-import-your.html

Ryszard Szopa said...

Oh, it's a shame I didn't notice it.

Anyway, now I am done with the job and the simpler script was enough. Also, the Python script is so clear that I had the very feeling of knowing exactly what is going on.

Thanks once again!

zeaster said...

Hi, that's OK.
Sure, I'd like python script too.
It's more flexible and functionality by modifying the code.
The GUI version is for anyone who do not want to eat code but hungry.
It's easier to use.

ppy said...

Thanks for the amazing tool! :D
But I found some problem.
The post after the "<!--more-->" in Wordpress post can't be imported to Blogger. Is there any easy way to solve this problem? Or, I must remove the "<!--more-->" flag before I import the post.

Anyway, thanks a lot!

zeaster said...

Does it complain that it's invalid xml?
if true, you have to remove the flag.
The python script uses xmlrpclib to parse the response from wordpress.
The error shows up when some part of the response can not be parsed as valid xml by xmlrpclib.

Jamie said...

I would love to move my current WordPress blog over to Blogger but I do not know anything about "python" or the code that is involved with this. Could you please help me out?

My email address is JoshJamie@bellsouth.net.

Thanks so much!

zeaster said...

@jamie
there is a gui tool, it's easier to use.
http://zeaster.blogspot.com/2007/06/blogsync-03-released-comments-can-be.html

and a faq
http://zeaster.blogspot.com/2007/09/blogsync-faq.html

TJantunen said...

Hi,

I have made simple instructions to import BLogger posts to Wordpress, see http://tjantunen.com/2007/03/21/import-blogger-posts-to-wordpress/

feathervane said...

Hi. Greetings from the Philippines.

Dude, your a genius pythonic guy. You made my day. Thank you very much for your help and the great code works really really awesome.

Salamat.

ahs3 said...

amazing it works great!

Chiao Kee Lim said...

Hi, useful info. But I don't even know where to start! Ack! I'm using the wordpress version n Bustablog.com. How do I migrate my blog posts from there to Blogger using your script? Please help!

blah said...

dnt get it. :(

onlyme_6000 said...

Hello Mr Zhang, I tried to "export," from Wordpress and "import" the xml file it generates to Blogger but there is an error so nothing really gets transferred. So I want to say to all those who have been successful at using your tool that I am so envious! Because I don't understand "setting paramaters," "Debug" code or where that "terminal" is. So then that makes Cza-cza and me having the same feelings. If you are free to help, please email me. Thanks.

zeaster said...

@pending,
Google has released a blog converters.
You can find them on
http://code.google.com/p/google-blog-converters-appengine/

see the links on the above page.
for wordpress2blogger, you can try this,
http://wordpress2blogger.appspot.com/

Hope this helps.

Bob Nilsen said...

Just used this script, thanks!