A Return to BlogCFC

I decided a while back that I wanted to move from MangoBlog to something simpler. I wanted to get back to writing blogs rather than messing about with the application.

As you can tell from the title of this post and the lovely oranginess of my blog I ended up coming back to BlogCFC.

Please don't get me wrong. I really liked MangoBlog from a user perspective, but as an application, when I have maybe an hour and a bit at night to poke around the hood... Well, lets just say we never really got on that well. I love the interface and the skinning, but I just couldn't get my head around the architecture and I seemed to break more stuff than I fixed. The breaking point was when I moved to a new host and couldn't get the search to work, either the built in verity search or the Google CSE search plugin. Now that may be a factor of the shared hosting I'm using these days, but it still annoyed me, I couldn't get past it and on to writing anything!

I looked at leaving MangoBlog up and just starting again somewhere else, but I just didn't like the idea of leaving my old blog content in a busted up website. (My fault not MangoBlog's)

I've been trying to persuade my modest 180+ blog posts into another blogging application. I had no real interest in WordPress; never liked the interface.

Posterous quite happily imported my content, but it was all a bit untidy and would have taken me a life time to fix it. I have however, decided to put a few non-techie posts up on posterous, because it is such a lovely application for quick and easy personal and photographic blogging. I can write a post on my phone on the metro and post it in the 20 minutes it takes me to get home.

I tried to get posts into Blogger, but the API and import routines are rubbish and everytime I had a success I'd then be held up by yet another failure.

One of the things that did come out of messing with the Blogger Data API was a set of CFCs that gave me CF9 ORM access to the database. I'd thought of "reversing" the MangoBlog API to spit out the content, but given my previous "success" with the API and realising it actually gave me something to use to play with the new ORM features, I decided to take this route.

New... Tsk... You see how long I've been messing about with this stuff now?!! How long has CF9 actually been out now? 3 months?? I digress...

From the ORM I created a bunch of different functions and scripts to talk to the Blogger Data API, which eventually left me high and dry while trying to insert comments. Lets face it, the content on my blog "could do better", so the comments add value and I needed to maintained them as well.

I had the means to get data out of my blog, but I'd run out of options as to where to post it on a hosted solution. That meant I would have to host it myself, but I didn't want to write any code, so back to BlogCFC it is!

Why BlogCFC? Its great! I love it! Its simple, easy to use and pretty much lives in a dozen files. If I break the code, then there are only a few places for me to look. It really does "just work"! There are also a bunch of small things that I realised I missed from BlogCFC that aren't in the default MangoBlog. The bits that spring immediately to mind are enclosures, related entries and, the ego massager, stats.

How did I get everything from MangoBlog into BlogCFC? I wrote a surprisingly simple bit of code that used the ORM to pull the appropriate data out of the live database and insert it into a shiny new BlogCFC database using the exceptionally easy to use org.camden.blog.blog methods. I had to make a tweak to the method to insert comments, so that I could maintain the post date of comments. I also hacked in a login to the blog.cfc and page.cfc. Its not pretty, but it worked quite nicely once I mapped all the data from MangoBlog to BlogCFC.

I'm a hoarder. I keep copies of code from way back in the '90s, copies of database, documents, all sorts. I have a copy of my BlogCFC database from before I moved to MangoBlog. This meant that I could reattach my previous enclosures. I had to do this in two stages; first was a straight forward alias match, second stage was to do a title match and copy the data across. To be honest I was just happy that I'd managed to reattach all the enclosures, so I didn't look into why all the aliases didn't match. I think it might be blogcfc version related. Something that changed with the way the aliases are created, as it did seem to be older entries that didn't match.

The only other thing that I've done to my installation of BlogCFC is to add a post.cfm page. The blog entry url is different between MangoBlog and BlogCFC. BlogCFC includes the post date as part of the url. MangoBlog just uses the alias. I only realised this when I noticed that Google Analytics was showing a complete lack of traffic. The post.cfm page I've created looks up the entry by alias, rebuilds the URL and does a cflocation to the correct url using statuscode 302, permanent redirect.

I've attached the code that I used to talk to the Blogger Data API. This also includes the ORM set up for most of MangoBlog. The blogger stuff is all over the place, because I abandoned it, but it might be useful to someone. Feel free to use and abuse to your hearts content.

I've given the code I wrote to Ray Camden, so you never know, at some point, a cleaned up version of it may find its way into the new installer.

Now maybe I can get back to the blog round-up!! ;-)

Related Blog Entries

Welcome back. All your reasons were the same as mine, right down to using Posterous for images. Then I looked at getting Flickr to post to my blog which is dead simple so that took care of that as well.
# Posted By Andy Jarrett | 1/31/10 2:27 PM
Posters has sorted importing now..my blog is now all on posterous imported from Wordpress.
# Posted By john b | 5/6/10 11:12 PM
I'm surprised you couldn't get your head around it, perhaps you have spent too long using OO frameworks like coldspring and mach-II that you have have forgotten the classic way of CFML coding. I downloaded mango for the first time the other night and have found it to be extremely well written and easy to understand, in fact Ben Forta even said it was one the most well written apps he has used. I have already skinned it, done a few tweaks and customisations and not really had no issues so far working out where to find the code I need, and I rarely do any coding these days so my CFML is rusty as hell :-)
# Posted By Snake | 5/18/10 10:28 PM
Hi Nil,

I'm trying to migrate MangoBlog to Blog CFC. One of the problem is migrate Database. Can you tell me how to migrate database step by step?
# Posted By ppshein | 10/19/10 1:56 PM
@ppshein - Use the DAO objects in the attached download to access your mangoblog database tables and then push them into the the appropriate places in the BlogCFC tables. That is about it really.
# Posted By Stephen Moretti | 10/19/10 3:30 PM
If you don't mind, can you show me the simple usage (coding at least migrate to one table) of DAO for to migrate MangoBlog to BlogCFC?
# Posted By ppshein | 10/20/10 5:03 AM
@ppshein I have a complete blog post waiting to be released for you.
# Posted By Stephen Moretti | 10/20/10 9:07 AM
I have been struggling with the decision of what to do with my blog, it is on old 5.5 version of blogcfc, which has no anti-spam features which is proving to be a PITA as I get a spam and troll posts that I have to clean up. Unfortunately it seems that the amount of work required to upgrade blogCFC is actually more than migrating to another blog, so I am thinking about future upgrades now when making my decision.
MangoBlog does have the advantage of just being to auto upgrade from within the admin, no work involved, and installing plugins is equally as easy, does the latest blogCFC make it this as easy ?
Having deployed a few wordpress sites I can however say that Wordpress is the mutts nuts, thousands of plugins for just about anything you can imagine, and at any time you can extend your blog into a fully fledged website, add a community, e-commerce features, anything you can imagine, not to mention thousand sof themes to choose from, I have become somewhat of a fan and it is hard to find a reason not to use it other than having to learn PHP if you want to customise it.
# Posted By Russ | 10/20/10 10:39 AM

I actually don't remember the last time there was a database change to BlogCFC, possibly the comment moderation stuff, so I don't think that would be a massive issue. Given how long you've left it you are probably going to have to be careful, but it doesn't take much to set up a vanilla install of BlogCFC, especially as there is now an install process.

The only thing really stopping you from upgrading is the styling your blog. Again, the index.cfm, layouts, pods etc. don't really change that much, so I tend to find that a simple manual merge using eclipse or winmerge will do the trick. Then again, you've left it for so long to do the upgrade that it might be worth re-working the skinning on your blog from scratch. A quick glance at your blog seems to suggest that you haven't actually changed the underlying html greatly, so it might actually be relatively trivial to re-apply your css to a new installation of BlogCFC.

Whatever you do, whether its upgrade to a new version of BlogCFC or move to MangoBlog or Wordpress, I don't think the transition is going to be painless for you. Chances are that the import routine on MangoBlog will not be compatible your version of BlogCFC and you're going to have to reskin your blog which ever way you go.

Upgrading BlogCFC, if done regularly, is usually just a case of dropping in updated cfcs in one place with updated admin pages in another. Both of these usually remain entirely untouched. Its not really that much of a hardship.

Pods, probably the closest thing to plug-ins, are hellishly easy to write, because they are a standalone pieces of code with no convoluted route through frameworks. You simply enable them and order them in the admin with a check box and a number. That is it.

To be honest with you I don't use BlogCFC because I might want to make it into a fully fledged website. I don't have a need for masses of additional features provided via plug-ins. I'm a simple soul. I just want somewhere simple to write my techie ramblings that may be of vague interest to some people. Any additions I need are usually also pretty simple too. Wordpress is just overkill.
# Posted By Stephen Moretti | 10/20/10 2:04 PM
Russ, Stephen describes the upgrade process very nicely. (Thanks Stephen!) It is definitely a pain point when compared to Mango. My goal for the next major rev of BlogCFC is first to support skins, and once that is done, seamless upgrades. For the most part, no one touches core stuff, just layout, so once layout is totally broken away, auto updates should be much simpler.

Of course, none of that helps you right now. :)

I want to make one side comment about "full featured site" - don't forget BlogCFC supports Pages. Pages are generic ... well pages - that can contain anything you want. They automatically include the main blog layout but can be 'bare' too. So you can do "mini" CMS type things with BlogCFC. It won't replace Mura of course.
# Posted By Raymond Camden | 10/20/10 3:13 PM
I would like to run a copy of each blog so I have experience of them all and can really compare them, but the list upgrade tasks is huge, not just the current upgrade/change doc, but also the archived one as well. How about doing a clean install of blogCFC and migrating the existing data, would that be easier? How much has the database changed since 5.5
# Posted By Russ | 10/20/10 5:33 PM
In the readme file, I normally use a LOT of caps whenever a DB change is required. If you skim it, you should see it clearly enough - and as Stephen said - there shouldn't be many.
# Posted By Raymond Camden | 10/20/10 5:36 PM