WordPress To Croogo Migration

Posted by Matt on Mon, Jan 11 2010

I'd been wanting to dump WordPress for awhile. I'm extremely neutral on WordPress in general, but two things drove me nuts:

1) It took me way to long to make simple changes to themes or plugins. Probably my own fault, since I don't really know the WordPress API. But I hated dealing with any of the related code.

2) I had to choose between slow or crashy. I'm on the smallest SliceHost VM - which is generally fine for the dozen other sites that share it. But the two WordPress blogs felt so much slower. I tried the Super Cache plugin, which would bring down all the php-cgi processes randomly when running in "full" mode. Mostly this happened when I was composing a new post (something w/ the auto-save), but other times just randomly in the middle of the night. I was doing all that retarded shit to work around it, like running scripts in cron to check if the site was up and then restarting if need. I hate that.  I spent three hours rocking back and forth in the shower the day I turned that cron on.

What's Croogo?

Croogo is CakePHP CMS built by Fahad Ibnay Heylaal (@fahad19).  It is currently at version 1.2 (although I'm running trunk with no problems).  The full feature list is available on the wiki and their are a bunch of screenshots on Flickr

Why Croogo?

Because it's CakePHP based and it was released when I was at my most frustrated with WordPress. I'm really that easy.  I wanted something Cake based so it would be easy to tweak. Plus it uses Cake's theme, which I already know, so I was able to convert the old WordPress theme (with a few updates) in about 5 minutes. Also this allows me to eventually take all the (neglected) code running on sandbox.pseudocoder.com and move it here. I had been running the subdomain to keep Cake and WordPress separate.

How To Do It

It's actually not that hard...since I did all the work for you :)

1) Install Croogo following the instructions.

2) Head over to GitHub and grab the Bye WordPress plugin.  Follow the instructions.  I moved about 200 posts and 1000 comments for this site.  If you ever left a comment here please check to make sure it made it successfully.  Thanks.

3) Create a theme (or use the default one or the one theme that's been released)

There's Always a Catch

Ok, so it isn't quite that easy. Here's some things to watch out for.

1) Database character encoding.  I had some weird issues with angled quotes and em dash's. I never really sorted them out - I just fixed in the final database manually.

2) Manually copy uploads. The Bye WordPress plugin will move the DB records for the attachments, but not the actual attachments themselves. Just copy everything in /wp-content/uploads to /app/webroot/uploads. Croogo doesn't support sub directories in uploads the moment, but it works fine with the sub directory structure that you'll be taking from your WordPress install.

Note: WordPress references images by their full url including domain in your posts, so if you're doing the migration on a beta site (as you should) you'll still see broken images until you actually switch the domain over.

3) Spam protection. Croogo comes with Akismet support built in, but it isn't enough to set your API key (Admin -> Settings -> Service). You also need to turn it on for blog posts (Content -> Content types -> Blog -> Comments).

URLs

You'll probably want to maintain your old URLs. Thanks to Cake's routing this isn't hard. Here's a couple I used:

/archives/this-is-a-post-title

CroogoRouter::connect('/archives/:slug', array('controller' => 'nodes', 'action' => 'view', 'type' => 'blog'));

/2010/01/this-is-a-post-title

CroogoRouter::connect('/:year/:month/:slug', array('controller' => 'nodes', 'action' => 'view', 'type' => 'blog'), array('year' => '[12][0-9]{3}', 'month' => '0[1-9]|1[012]'));

/2010/01/11/this-is-a-post-title

CroogoRouter::connect('/archives/:year/:month/:day/:slug', array('controller' => 'nodes', 'action' => 'view', 'type' => 'blog'), array('year' => '[12][0-9]{3}', 'month' => '0[1-9]|1[012]', 'day' => '0[1-9]|[12][0-9]|3[01]'));

/page-title

CroogoRouter::connect('/:slug', array('controller' => 'nodes', 'action' => 'view', 'type' => 'page'), array('slug' => '[\w\n\-]+'));

Note: It's important where in /app/config/routes.php you put these lines. If a URL maps to multiple routes it will use the first one in the file. So put these all at the top or at least the top of the section they apply to.

More Note: routes.php is included in the Croogo package, so if you do an update you could lose these changes.

Make It Fast

I updated my HTML Cache plugin so that it's Croogo compatible.  It generates static HTML files for pages, which are super fast to load.  Go ahead - refresh this page.  Bam!  Done!  The idea is basically the same as the SuperCache plugin for WordPress...except it doesn't crash the server.  I'll be adding that feature in a future version.

Mini Review

All thumbs up so far.  And since I decided to replace all the fingers on one hand with thumbs (thumbs are awesome!) that's like 6 thumbs up.  The docs are bit sparse, but if you're familar with Cake you should be able to dig in the code to figure stuff out.  Likewise the admin isn't as slick as WordPress', but it's certainly functional.  All the basic functionality you'd want for a blog is there - maybe missing some polish, but certainly working.

Wrap

I'd definitely recommend making the switch if you're frustrated with WordPress and would rather deal with a Cake based platform.  Plus it will give you something to blog about if it's been over a month since your last post.


Posted in CakePHP

17 Comments

primeminister said on Jan 12, 2010
Nice one Matt! Just was thinking about that myself to update cake toppings and my business website but the db migration was the problem. Now with your plugin I'm gonna give it a try.

Wanna help Fahad to develop Croogo, because I can use it for my customers
Fahad said on Jan 12, 2010
great stuff Matt! this post will definitely motivate other cakephp bloggers to migrate to Croogo.

right now, I am busy unit testing the application. I will think about a new look for admin panel after that.
Brendon Kozlowski said on Jan 12, 2010
I've been using s9y (serendipity) for my blog. I've been tempted a few times to switch to something else, but the allure to create my own blog system is much more tempting. However, for the short term, this post is somewhat tempting in its own right. The only thing I've ever really been stumped over is how to implement hooks for plugins...and Fahad has already seemed to have discovered that loophole (and unit testing to boot!). ;)
Andrew said on Jan 12, 2010
Congrats on getting Croogo set up. Also great work on the migration plugin.

Once my work dies down I will be creating some more themes and plugins.
fightgoose said on Jan 13, 2010
"The idea is basically the same as the SuperCache plugin for WordPress...except it doesn't crash the server. I'll be adding that feature in a future version."

LOL! This is why I have trouble deciding whether your blog feed belongs in Google Reader under "cakephp" or "comedy-gold"!

Hope you resume posting, the Cake community has been a bit quiet of late. Good job on switching to Croogo - I've gotta check it out now, I had no idea it was already in such a polished state.
lixiphp said on Jan 13, 2010
great! thanks.
Gabri said on Feb 24, 2010
I don't know a lot Wordpress implementation, anyway, do you think there could be a smart way to "translate" wordpress plugins to Croogo plugins?
Thanks (I use Croogo since few months!)
jacmoe said on Mar 15, 2010
Hi - I know I am a bit late to the party, but I switched from Wordpress to Croogo just now and noticed that it lacked support for code highlighting.
I figured out how to hack Croogo - and wrote a post about it on my blog (just follow the link to my site. There's only two blog entries for now).

And my question is:
How did you add code highlighting ? :)

Jacob
Matt said on Mar 17, 2010
I'm using the same SyntaxHighlighter package that you are ( http://alexgorbatchev.com/wiki/SyntaxHighlighter ), but there isn't much of an integration with Croogo. I have to switch to HTML mode and add the tags manually. I hate it. And sometimes saving will complete f-up all the code.

I'll check out your post - I'm definitely looking for a better solution.
jacmoe said on Mar 18, 2010
My solution is not f-up safe either. :(
I am seriously considering looking into replacing TinyMCE with markitup or similar non-wysiwyg editor.

If only I could figure out how to prevent TinyMCE from messing with the code.
I've heard that there's a but in the HTML view, but I haven't looked into it.
Apparently, you can fix it by installing something.

So, the quest continues... :)
jacmoe said on Mar 18, 2010
Not a 'but', but a 'bug' in the HTML view ^ :P
jacmoe said on Mar 19, 2010
Awesome stuff! -> Fahad just turned TinyMCE into a plugin. :)
Which means it's easier to either configure or replace it.
I'll probably go for something which doesn't mess with the code like a wysiwyg editor does.
jacmoe said on Mar 25, 2010
@Matt:
I don't know if you're interested, but I just made two (unfinished, but usable) plugins for Croogo: Markitup and Highlighter. :)

View it here:
http://www.jacmoe.dk/blog/markitup-and-highlighter-plugins-for-croogo

I
submitted them as tickets to Croogo as well.
Now I can use a markup editor with proper highlighting in Croogo. Just turn off the TinyMCE plugin first.
jacmoe said on Mar 25, 2010
Looks like Croogo messed up the link - here it is again:
http://www.jacmoe.dk/blog/markitup-and-highlighter-plugins-for-croogo
Carlitos said on Apr 02, 2010
Ohh my God! Congratulations man! The Croogo is a magnific CMS...

long life to the Croogo!!!

[]´s
dalily said on Jul 06, 2010
croogo is a super cakecms i just rewrite a big website by croogo www.almountakhab.com

i will publish my sondage plugin soon.
peace for u fahed.
jeremyharris said on Aug 09, 2010
I know it's a bit late, but...

I also built a plugin based on syntax highlighter. It allows you to choose your theme, languages to load, and customize the default setup like you would manually but instead via the admin section.

If you're interested:
http://codaset.com/jeremyharris/croogo-syntax-plugin

Add new comment