This page is outdated. Please click here for the update. Comments are closed on this post.
As I have not heard anything about the solution to this problem, I wrote a script. This script is a simple but powerful 😉 script which extracts the posts and comments from RSS feeds at blogger.com.
Instructions:
Copy the script to your main WordPress directory and run it (http://your.name/blogger-beta-import.php). The options are self-explanatory. This means you can customize the category and user before importing.
Warning:
This script represents a security hazard if left on the server. Once you are finished, delete it. Don’t even rename or save a copy on the server. The script does not honor WordPress authentication and checks, but utilizes some of WordPress’ functions.
Limitations:
- No handling of images (stay on blogger server)
- Comments will have the names but not email or URL – limitation with RSS from Blogger
- Unlikely to work if you use other comment systems
- You need to enable RSS feed for comments – very important!
As for images, they will stay in blogger.com but I suggest you download them at once to your server as Blogger does not allow hot-linking (images will be blocked). You don’t have to do it one by one, you can use this plugin by Notions: Blogger Image Import. I’ve tried it and it worked well. One thing is that it depends on CURL to download images – servers without this extension will not execute the script. Let me know as I have a workaround for this, provided that your PHP version is later than 4.3.0.
Please don’t look at the code as it is written in 2 hours without so many cosmetic or improvements in efficiency. This script will work on existing WordPress installations but due to some assumptions made, it may break certain things like post counts for categories, etc. I suggest use it only on a virgin WordPress installation. However, I’ve tried it to import several different blogs and the result is awesome – it looks like multi-user blog 🙂
This code will be short-lived, I think as Blogger is finalizing their system out of Beta. One little change on their system would mean disaster for this script, and I am not sure I will have the time to give any kind of support. So, be quick and import now, while the script still works!
I have not tested this script with blogs larger than 300, if you encounter problems do let me know, maybe we can split executions.
Download the script here:
blogger-beta-import.zip (2.81KB)
blogger-beta-import-0.2.zip (3.64KB)
blogger-beta-import-0.3.zip (3.69KB)
blogger-beta-import-0.4.zip (4.86KB)
blogger-beta-import-0.5.zip (4.94KB)
Changelog:
2006-12-22:
- Added ability to add commentor URL and email since these data can’t be obtained from RSS.
- Added extra checks to terminate script if something fails. No use wasting user time to wait for a broken result.
2007-01-01:
- Bugfix: When a comment author’s name contains apostrophes it will fail to be loaded into the database. Update 0.3 fixed that – thanks to Dawn.
2007-01-11:
- Added automated checking for feed retrieval mechanism (fopen or curl). If both are not available, the script will tell you and not run 😉
- Added code for retrieval using curl.
- Added ability to make step by step imports – useful for people having bandwidth or server speed problems. Requested by Dawn.
- This script has only been tested in few sites, so if you encounter any problems do let me know.
2007-01-14:
- Bugfix: First import does not work, page have to be refreshed to make it work – thanks to Jonas.
I suggest you download the script only from this site, especially if you’re not a programmer as PHP codes are easily modifiable for malicious intent.
I will not be liable for any problems you might have with your WordPress installation. Use this script at your own risk.
Comments are welcome but I may take some time to respond as my time is limited.
How to make sure full feeds are available:
Switch to Advanced Mode and make sure your settings are like this:
Special Notes:
Thanks to Charles Wesley for his suggestions on using the CURL library.
Tested On WordPress versions:
- 2.0.5 – Working.
- 2.0.6 – Working.
- 2.0.7 – Working.
- 2.1 – Working. Thanks to Ricardo
TODO:
Import by a number of posts at a time (staged import)– done- Haloscan import support
- Mapping of categories from blogger
- Mapping of authors from blogger
- As a plugin
- Include an option to import all posts without staging
- Maintain permalinks from blogger
Hi Ady,
Yes that is my problem. I used the ftp update version of blogger to my own website. So all the images are still on my host. I will look at notions plug in and see if I can mod it.
@Reboots: Yes that would be the best. Mod it so that it takes images from your own server /blog/uploaded_images/… to the new location. It should be lightning fast. Good luck!
Hi ady,
Although I spent the last weekend going through and manually copying my URL’s from my blogger posts to wordpress, I thought you might want to experiment if others have the same issue.
I have placed one of my blog pages that uses the BlogItemURL at http://neversleepz-tunes.blogspot.com/ so you can test out.
Regards, Kon
@Kon: It seems that the full feed provided by blogger does not at all contain the URL stored in BlogItemURL making it impossible for us to grab. We can only make use of what they provide us with. Sorry 🙁
I was trying to test my new code for importing in stages but my script can’t connect to blogger due to network problems. I shall try again tomorrow maybe.
Your script saved me a ton of grief at a time when I am moving my domains and the New Blogger caught me off-guard. Thank you very, very much!
A new version of the script has been released featuring step by step import and alternative to url_fopen. Please check it out. Sorry I can’t email you individually yet.
I’m with Amad (#62). I don’t understand a) how to “copy the script to your wordpress directory” nor do I understand your answer (#64). I’m pretty handy but you’re assuming I know something I don’t … like maybe you’re assuming we’re hosting our blogs off wordpress on our own domain???
When you say, “WordPress.com users can’t use this” it completely throws me. Isn’t the whole idea that we’re moving blogger beta files to WordPress? Doesn’t that imply by definition that we are all “WordPress.com users?”
Sorry if I’m being dense. I’ve read and read and read this post and the comments and I’m not following.
@Cynthia: OK you need to read carefully my answer below (be really careful to differentiate .com and .org). If you go to http://www.wordpress.com and http://www.wordpress.org you can tell the difference.
WordPress.com is a hosting service where you sign up for a blog. You can use it on your own domain with a fee, or host it for free with a URL like http://cynthia.wordpress.com (I have an account http://romantika.wordpress.com). You don’t have any control to your files except for uploaded images during posts, and no access using FTP (file transfer protocol).
WordPress.org is a place where you download the blog platform for use on your own domain & server. You have total control over your files and upload this script as you wish using FTP (file transfer protocol).
Since I am not in any way related to WordPress.com I don’t control what they install on their server.
Simple statement: Not all of us are WordPress.com users, we are all WordPress users.
Hope my explanation is clear.
I have to say THANKS 🙂
Works GREAT!!!!!
I think I heard that you could not use this script to upload the images that were in your blogger posts but this cript uploaded the images anyway!!!!
Visit the blog:
http://www.alabamaweather.org/blog
@Kenny: Dude, be careful. Try right-clicking on your images and see the properties. If you hosted the images somewhere else it’s fine, but if you see blogger.com you really need to import those images over.
Refreshing the page a few times will disable the images if you still have them hosted over there.
Thanks!
No problem. I tried my own means of changing the template to include the blogitemurl, but really the time you saved me more than justified the small time copying URL’s across.
It didn´t work with me :/ Dunno why. It tells me how many posts I have etc, and then it says I´m done, but no posts appears on my page..
@Jonas: Thanks, you found a bug. I’ve fixed it and republished it as version 0.5. Please download it again.
Sorry about that.
Cool, works perfectly now! Thanks a lot! 🙂
hi, I’m having a bit of trouble with the script. I have 672 posts to import from blogger. It gets through the first page fine and then i get this:
ERROR: [] Unable to extract initial data from http://.blogspot.com/feeds/posts/full?alt=rss&max-results=1&start-index=200000
any ideas?
Love the script though, thanks for your work
@Norm: Did you enter the blogger id (first text box)?
yes, I entered normdebracopeland
my old blog address was normdebracopeland.blogspot.com
it did import about 70 posts before it quit
thanks so much for the quick reply, appreciate it