Monday, November 20, 2006

Blogger Backup using the C# GData Client Library...

I think I've finally found a viable, working method to easily back up my Blogger Posts to disk.

Using the Google GData API and their C# client library implementation, I've created a simple proof of concept Blogger Backup utility in which I was able to save all of my 2058 blog posts to individual XML files.

Rock On!

Here's a couple screenshots of the results...

 

I've just requested a CodePlex project and will be getting the code into releasable shape (beta at least) tomorrow (being on vacation means I can code all day... ;)

The current output/save format is Atom XML (which comes for free in the GData library). One of the things I'd really like to do is also support BlogML. Since it's XML to XML, that should be a simple transform away...

More to follow in the coming days...

4 comments:

Anonymous said...

But I think that only works if you are on the Beta Blogger, otherwise it will download only the last 25 blog entries.

-Marcelo
http://marcelo.sampasite.com

Thomas said...

Hey Greg, well done, I've been waiting for something like this!

Go Greg :-)

Cheers, Thomas

Greg said...

That's what I thought at first too, but I was able to make it work.

But you're kind of right... I had to do it in 25 post chunks.

With my Blogger 2.0 blog, I was indeed able to use it to download ALL 2058 of my posts.

The trick is the FeedQuery.EndDate property.

Download the newest, latest 25 posts. Get the AtomEntry.Updated date of the oldest/last.

Set the FeedQuery.EndDate to that oldest date and re-issue/re-execute the query. You'll now get the previous/next oldest 25. Wash, rinse, repeat... going farther backward in time with each query.

I was able to use this method to page backward in time, to get ALL of my Blogger 2.0 (i.e. not the beta, which is 3.0) blog posts...

It may not be pretty, but it sure does get the job done. ;)

Павелъ Дончевъ said...

Nice idea!
I am currently working with C# / Blogger API, you can checkout at my blog for some posts on this topic.