On Fri, Apr 14, 2006 at 05:58:44PM +0200, Christophe Appell wrote:
> So, the question :
> How can I set things up (or rather ask someone qualified to set things
> up) so that there is a development server to code and test on (with
> real data) and a production server that's relatively easy to push up
> the code to once it's signed off on without squashing the live data ?

The first minimal step is to reorganize so that all your code objects are
in separate folders from any content objects. Once you do that,
you could use ZSyncer to push changes to code folders up to 

(This is assuming that you don't have a total mishmash of
code and content in the same object... for that, see below.)

However, this is a stopgap solution; it's no substitute for revision
control, and it doesn't scale to multiple developers.

I would strongly advise you to remove all "code" objects (dtml,
zpt, zsql, python scripts) from the ZODB and keep them under version
control on the filesystem.  Leave only "content" or "data" objects in
the ZODB.

One way to do this is something like the following:

* install FSDump.

* Go to one of your code folders, use FSDump to copy the contents to the

* install FileSystemSite.
* Create a new Product on the filesystem. Initially it will contain
  only one or more subdirectories in which you will put all the files
  you dumped with FSDump; plus an __init__.py that registers that 
  subdirectory.  FileSystemSite includes an example of what that
  might look like.

* In the ZMI, delete the folder that you dumped and replace it
  with a FileSystemSite instance.

Assuming that everything worked when you started this process,
it should still work now :-)

Rinse, lather, repeat until you have no more code in the ZODB.

Now that you have code on the filesystem, you can do wonderful
things like put it under revision control, write and run test suites,
and write scripts to sanely deploy everything. No more wiping
out the production ZODB.

If you do have dtml or zpt that contain a mishmash of code and content,
you can do this incrementally. For each mishmash object, refactor it
into two or more objects, where some contain nothing but "dumb" content
and some contain code.  Then move the code objects into separate folders
and dump them as above. Until you've finished this process, you can
use ZSyncer to manage the transfer of mishmash objects to production.

There's more.  Definitely read this article and comments if you have not


Paul Winkler
For more information about ZODB, see the ZODB Wiki:

ZODB-Dev mailing list  -  ZODB-Dev@zope.org

Reply via email to