Latest Posts

Archives [+]

Categories [+]

Authors [+]

Migrating Jackrabbit Apps and Content to CRX

One of the better-hidden features of CRX is that CRX is "Drop-in" compatible with Apache Jackrabbit:

A Day CRX release is based on the latest unmodified official Jackrabbit release. Furthermore, starting with CRX v1.4 release, Day CRX and Apache Jackrabbit are “code drop-in” compatible with the following benefits:[...]

Yesterday, I was curious to try my luck and find out what that actually means. For one thing the JCR standard gurantees compatibility of applications. If an application should additionally use Jackrabbit's non-JCR classes the application will also work in CRX because these classes are all available and unmodified in CRX (for example, I find org.apache.jackrabbit.util.Text quite helpful). Therefore, apart from getting the session object no code should have to change.

For the content it turns out that things are very simple as well. You can just grab a Jackrabbit workspace directory and copy it in CRX. If you have defined custom namespaces and node types just delete the respective files in CRX and copy over the Jackrabbit files (assuming you have a fresh clean CRX installation). CRX will merge your custom definition with its own definitions. So that's the whole import (shutdown CRX and Jackrabbit before you do this):

cp $JRHOME/repository/namespaces/* $CRXHOME/repository/namespaces/
cp $JRHOME/repository/nodetypes/custom_nodetypes.xml $CRXHOME/repository/nodetypes/
cp -R $JRHOME/repository/workspaces/default  $CRXHOME/repository/workspaces/

Start CRX and -voila- there are the node types and the new migrated workspace. The resulting workspace will, of course, still run on the Derby Persistence Manager. For getting it into the TarPM you would still have to export/import the content.

Displaimer: if you want to try this on your production servers: please talk to our support guys first... I was just playing around.

 
(optional)
1 comment
I'm getting some good results using Jackrabbit on Glassfish does CRX work well on Glassfish?
0 Replies » Reply