Personal tools
You are here: Home Documentation How-tos Multiple Plone sites per zope instance -- using separate Data.fs files for each one.
Support

Get Help

Join our chat rooms or support forums if you have more specific questions.

Plone Training
Learn how to design, build, and deploy a website in Plone through one of the numerous Plone training sessions around the world.
Find Plone training…
 
Document Actions

Multiple Plone sites per zope instance -- using separate Data.fs files for each one.

This How-to applies to: Plone 2.5.x, Plone 2.1.x, Plone 2.0.x
This How-to is intended for: Server Administrators

Using Zope's mount point facilities, distinct ZODB files under the main zope root can be created to host Plone sites.

Introduction


In some cases, administrators with multiple Plone sites may want to isolate each site in a distinct database file.  By default there is just one "Data.fs" file containing the entire Zope site.  If each Plone site is in a distinct file, issues of backup, deletion, and relocation can (hopefully) be separable.  This is an alternative to running multiple Zope instances.  Discussion is welcome, since the author was attempting to optimize the problem of running multiple Plone sites corresponding to different user groups.  N.B. this discussion applies only to vanilla ZODB sites and not to ZEO sites. See the comment below regarding ZEO sites.

Steps to carry out


1.) Edit Zope.conf

In zope.conf, the main Data.fs storage is defined by

<zodb_db main>
# Main FileStorage database
<filestorage>
path $INSTANCE/var/Data.fs
</filestorage>
mount-point /
</zodb_db>

Adding another section below this like

<zodb_db group1>
# FileStorage for group1
<filestorage>
path $INSTANCE/var/Data_group1.fs
</filestorage>
mount-point /group1
</zodb_db>

Restarting zope will establish a new the file Data_group1.fs and make the mount point "/group1" available under the zope structure.

However, the new mount point "/group1", is not yet usable.


2.) Use the zope management interface to enable the mount point.

The next step is to go to the Zope management page (not Plone's ZMI), and go to the Root Folder.  In the "Add" pull down menu near the bottom, find the "ZODB Mount Point" entry and choose it.  The "/group1" entry added above should be there, but not yet enabled.  Select the new mount point via the check box, and click on "Create Selected Mount Points"  After doing this, the new mount point should appear in the Root Folder as a subfolder.


3.) Create the Plone site inside the new subfolder.

Click on the new subfolder "/group1" and go inside.  Once there, use the pull down "Add" menu and choose the "Plone Site" entry.  Create a Plone site as usual and you are on your way.  The site will be contained in the distinct "Data_group1.fs" file. 

Issues
  • The path to the plone site is http://yoursite:8080/group1/<sitename> where <sitename> is the name given the Plone site on creation.  It makes sense to choose the names of "group1" and "sitename" in some sensible fashion to avoid a redundant name (easy to get this wrong the first time).

  • This technique is largely untested by the author of this How-to, hence tread carefully.  Feedback is welcome.

  • This discussion does NOT apply to ZEO based sites.  In particular: "the recipe only applies to Zope installs without ZEO. There is considerably more than needs to be done to get a mount point in ZEO. See: http://trizpug.org/Members/cbc/mkzeowmp.txt/file_view and http://thread.gmane.org/gmane.org.user-groups.zope.trizpug/528/focus=528"




by slm23 — last modified April 26, 2007 - 01:49 All content is copyright Plone Foundation and the individual contributors.

Disintegrate multiple Plones

Posted by jplasser at September 21, 2006 - 19:58
When you don't have more Plone instances in one single Zope instance, this method may be a simple way to extract each Plone instance into a separate data.fs. From then on you can use this files to mount them into other Zope instances. I have not tested this but it sounds reasonable.

-Jürgen

First think then write ... ;)

Posted by jplasser at September 21, 2006 - 20:03
I meant "When you do have more Plone ..." (and you should read "these files" :) - sorry!

Your correct Sir!!!

Posted by rawbobb at October 10, 2006 - 02:07
I do this all the time, and move instances between windows and *nix instances, also.
A best practice (for me) is that each site has it's own .fs, and therefore it's own directory, and therefore it's own plone site. Nothing else is included in the .fs.

converting existing plone instances to mounted

Posted by hoss at June 24, 2007 - 18:10
I'm sorry if this should be obvious, but I'm unsure of how to convert an existing plone instance to one that is mounted from its own .fs file. I have a single zope with a single plone instance (named 'plone') in the root folder, using the good ol' Data.fs. I want to add another plone instance, but I'd like both plones to act as mount points, as described in this HOWTO. Adding the 2nd plone seems trivial -- I can just follow the steps described. But how do I safely convert the existing plone to a mount point, i.e. get it out of Data.fs and into its own .fs? Thanks.

cut&paste Plone Site to new mount makes it disappear

Posted by liawagner at March 22, 2008 - 09:09
I thought the obvious way to transfer a Plone Site to a mounted Test1.fs database was to cut and paste it in the ZMI. But when looking at the Test1 database after pasting, the size does not change. If you then pack the databases your site disappers! I have found no way to undo this either. Opening the folder will result in an error (Error Type: POSKeyError) on Plone 3.0.6

I then tried to do the same thing with *copy* and paste and it worked. The Test1.fs database size increased by about 900kB, and after deleting the Plone Site from the main DB and packing the main DB everything was fie without errors.

Maybe this is obvious to those with more in-depth Zope knowledge, as it seems to me that cut and paste only transfers the reference to the Plone Site and not the site itself, whereas copy and paste (with subsequent deletion of the original site) actually creates a new copy of the Plone Site object in the newly mounted database as intended.

zeo and zodb mounts

Posted by temitchell at October 4, 2006 - 20:16
After reading many articles on how hard it was to mount multiple databases using zeo I was amazed at how easy it actually is. With plone 2.5 install zeo server comes set up with two clients. You really only have to do the following to add additional zodb mounts:

in server/etc/zeo.conf add:

<filestorage 2>
path $INSTANCE/var/mynew.fs
</filestorage>


then in the client1 and client2 zope.conf add the new mount point

<zodb_db mynew>
<zeoclient>
server servername:port
storage 2
name mynewdb
var $INSTANCE/var
</zeoclient>
mount-point mynew
</zodb_db>

then kick 'er over, you will see the new mynew.fs created and it will appear in the databases under control panel. Just go and add the new ZODB mount as normal.

It appears to be working fine for me.

To your point

Posted by rawbobb at October 10, 2006 - 02:09
This technique is largely untested by the author of this How-to, hence tread carefully. Feedback is welcome....

I do this all the time (make sure your zope and plone versions are the same!!!)

plone upgrades

Posted by dhart at December 26, 2006 - 22:57
I use this technique to manage multiple Plone sites; as others have pointed out, it's safe and easy.

It also makes Plone upgrades easier; simply install the desired new Zope in a unique location (e.g. /opt/zope/296), create a new Zope instance with the latest Plone products installed (e.g. /var/lib/zope/instances/migrate-target), *copy* the old Plone site's Data.fs (ZODB mount point), and run portal migration. This way, migration kinks can be worked out safely; if necessary, start over with a fresh copy of Data.fs. When migration is complete and tested, Apache rewrites can be changed for a near seamless migration.

Note, in the <zodb_db> section, I typically also add::
#explicit declaration of object ZODB mount point object type
container-class OFS.Folder.Folder
#performance/memory tuning
pool-size 8
cache-size 2000

Previous Plone Version

Posted by r0ver at January 22, 2007 - 14:31
Hello

Sorry to point this bue this practice is allowed in previous plone versions, are there any particular reason to say that's a plone 2.5 one ?

kind regards
r.

Re: Previous Plone Version

Posted by davconvent at January 25, 2007 - 10:03
This technique is a Zope feature, it's not restricted to Plone portals.

So yes, you can apply that technique to sites running older Plone versions :-)

Mounting an existing Plone site

Posted by sergey_v at May 10, 2007 - 04:45
I just have spent some time trying to mount an existing Data.fs in order to access data there and would like to share my experience.

There seems to be a little trick which seems not to be documented very well. Zope actually doesn't mount the "root" of object tree, which would be a behaviour similiar to Unix mount. What it does is mounting an _object_ within that tree, which has the same name as the mount point. So if, for example, we want to access a folder called "mysites" located at the root of a ZODB we're trying to mount, we have to call the mount point "mysites" as well.

Also, in case we want to mount a Plone Site (or some other object different from Folder), there's a container-class parameter in <zodb_db> section.

Read this document in spanish

Posted by r0ver at June 23, 2008 - 20:44
Múltiples sitios plones en una instancia zope - usando un archivo Data.fs por cada sitio: http://plone.org/countries/conosur/documentacion/multiples-sitios-plones

For any issues with the web site functionality, please file a ticket.

Please consult the policy on plone.org content if you want your content published on this site.

Servers and hosting by