Mounting portal_catalog in a separate ZODB
Rationale
Having the Portal catalog separated out from the main ZODB has the following advantages:
- you can have different cache settings in the 'zope.conf' for your main content and for the portal cache
- you can backup the portal catalog separately
- being a separate file, the portal catalog ZODB file can be stored on a separate disk, giving an additional performance advantage.
Prerequisites
To get the most out of this HOWTO, you should be familar with the following concepts:
- setting up a Plone Site
- editing the 'zope.conf'
- ZEO storages and ZODB mountpoints
You should read the mount-zeo-into-plonesite HOWTO
Preparation
We'll create a template database which we'll use later to mount things from into our root Plone Site.
Create a new Zope Instance as you usually do (don't create a Plone Site yet)
Edit the 'zope.conf' of the instance and add a new database. Note that I use "var_nobackup", so if you use the same config, create that directory.:
<zodb_db empty> <filestorage> path $INSTANCE_HOME/var_nobackup/empty.fs </filestorage> mount-point /empty </zodb_db>Start up the zope instance. Inside the ZMI, add a "ZODB Mount Point" object. Check the "create missing folders..." checkbox and add the "empty" database.
The "/empty" path should now be accessible within the ZMI. Inside that folder, add a new Plone Site. I'll name it "plone".
Inside that Plone Site, add a new folder using plone, that is not iside the ZMI. I'll call that folder "content". That's where my segmented content will go (not part of this HOWTO)
- Shut down zope, and comment out the "empty" zodb_db section from your zope.conf.
The database in '$INSTANCE_HOME/var_nobackup/empty.fs' is now our template database we'll use from now on.
Removing the portal_catalog and using the one from the template database
Here we're going to setup a new Plone Site and configure it such that this instance will use the portal_catalog object from an separate database.
Create a new Plone Instance the usual way. I'll name it "plone".
Using the ZMI, delete the "portal_catalog" object from your Plone Site. Your Plone Site will no longer work, we'll fix that in a minute :)
Shut down Zope.
Copy the template database to your var directory. I'll name that one "catalog.fs".
Add the following to your 'zope.conf':
<zodb_db catalog> # CATALOG fs #container-class Products.ATContentTypes.content.folder.ATFolder mount-point /plone/portal_catalog:/empty/plone/portal_catalog <filestorage> path $INSTANCE_HOME/var/catalog.fs </filestorage> </zodb_db>Startup your Zope again.
Using the ZMI, add a "Zodb Mount Point" inside your Plone Site. The "portal_catalog" database should be available. Dont forget to check "add missing folders...".
Check that you now have a "portal_catalog" object visible in the ZMI.
Using the ZMI, go to the portal_catalog's "advanced" tab and click "rebuild catalog".
