Moving from Mach II to Coldbox


We have an application is currently running with Mach II, however we’re looking at moving over to Coldbox. The two questions we have at the moment, is, can we run Mach II and Coldbox side-by-side, and, is it possible to move seamlessly from Mach II to Coldbox? If yes to either question, how would we go about it?

Kind regards,

The answer is yes to both questions.

Probably the best way is using a mod rewrite with your Application Server, whether it be IIS, Tomcat, Apache or whatever you use. This would allow you to put rules in place, that used the old routes to then slowly migrate over to the new way.

How the new way is done is up to you, but it can be done as a slow migration with one step at a time.

You should be able to move over without too much issue.

Firstly, the easiest way to segregate ColdBox is to simply put it in a sub folder. ColdBox will automatically calculate its appMapping setting and if you use that setting everywhere, you can move the app out of the sub folder at a later date and everything will still just work. You could use Andrew’s rewrite suggestion to make the sub folder invisible to the outside world

If you want to have ColdBox live right beside MachII, that should be possible as well. I don’t know much about MachII, but the entry point to ColdBox all flows through the onRequestStart in Application.cfc where it executes the processColdBoxRequest() bit. All you have to do is control that line of code and you can control whether or not ColdBox runs to process the request. That can simply boil down to a simple “if” statement that detects which URL is being run and routes accordingly.

Since the internal chunks of ColdBox such as WireBox, LogBox, and CacheBox all work independently as standalone apps, you could even start integrating any of those into your app now and then just replace the stand alone version with the bits that come with ColdBox to reduce the amount of change later.

I would recommend converting one chunk of your site at a time. For instance, if you have the following areas of your site:

Then I would take that chunk and rewrite just it as well as the models used by it. Then roll it out, and choose a different chunk of your site to rework. ColdBox should be able to live inside the same application scope so you can create adapters to allow the new ColdBox site to talk to old authentication mechanism until you get a chance to rewrite it into the new API.



ColdBox Platform Evangelist
Ortus Solutions, Corp

ColdBox Platform: