Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

pypm install zodbupdate

How to install zodbupdate

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install zodbupdate
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.5 Available View build log
0.4 Available View build log
Windows (64-bit)
0.5 Available View build log
0.4 Available View build log
Mac OS X (10.5+)
0.5 Available View build log
0.4 Available View build log
Linux (32-bit)
0.5 Available View build log
0.4 Available View build log
Linux (64-bit)
0.5 Available View build log
0.4 Available View build log
ZPL 2.1
Lastest release
version 0.5 on Jan 5th, 2011

This package provides a tool that automatically identifies and updates references from persistent objects to classes that are in the process of being moved from one module to another and/or being renamed.

If a class is being moved or renamed, you need to update all references from your database to the new name before finally deleting the old code.

This tool looks through all current objects of your database, identifies moved/renamed classes and touches objects accordingly. It creates transactions that contains the update of your database (one transaction every 100000 records).

Having run this tool, you are then free to delete the old code.


Installing the egg of this tool provides a console script zodbupdate which you can call giving either a FileStorage filename or a configuration file defining a storage:

$ zodbupdate -f Data.fs
$ zodbupdate -c zodb.conf

Detailed usage information is available:

$ zodbupdate -h
Custom software/eggs

It is important to install this egg in an interpreter/environment where your software is installed as well. If you're using a regular Python installation or virtualenv, just installing the package using easy_install should be fine.

If you are using buildout, installing can be done using the egg recipe with this configuration:

parts += zodbupdate

recipe = zc.recipe.egg
eggs = zodbupdate
    <list additional eggs here>

If you do not install zodbupdate together with the necessary software it will report missing classes and not touch your database.

Non-FileStorage configurations

You can configure any storage known to your ZODB installation by providing a ZConfig configuration file (similar to zope.conf). For example you can connect to a ZEO server by providing a config file zeo.conf:

    storage 1

And then running zodbupdate using:

$ zodbupdate -c zeo.conf
Pre-defined rename rules

Rename rules can be defined using entry points:

      entry_points = """
      renames = mypackage.mymodule:rename_dict

Rename rules are dictionaries that map old class names to new class names:

renames = {'mypackage.mymodule ClassName':
           'otherpackage.othermodule OtherClass'}

As soon as you have rules defined, you can already remove the old import location mentioned in them.


The option --pack will pack the storage on success. (You tell your users to use that option. If they never pack their storage, it is a good occasion).

Problems and solutions
Your Data.fs has POSKey errors

If you call zodbupdate with -f and the path to your Data.fs, records triggering those errors will be ignored.

Your Data.fs is old, have been created with Zope 2 and you get strange errors

Some special support for an old record format got removed from Python 2.6. Running zodbupdate with the Python pickler (-p Python) will load those records and fix them.

This will fix your Data.fs.

You have an another error

We recommand to run zodbupdate with -v -d -p Python to get the maximum of information.

If you are working on big storages, you can use the option -o to re-run zodbupdate at a failing record you previously encountered afterward.


0.5 (2010-10-07)
  • More debug logging shows now the currently processed OID (that is helpful to determine which object misses the factory).

  • Support for missing factories have been improved: an error used to occur if a pickle needed an update and contained a reference to a missing class (not instance of this class).

    This case is now fixed.

  • Python 2.4 is no longer supported. Please stick to version 0.3 if you need Python .4 support.

0.4 (2010-07-14)
  • Add an option to debug broken records.
  • Add an option to skip records.
  • Add an option to use Python unPickler instead of C one. This let you debug records. As well Python unPickler let you update old ExtensionClass records who had a special hack in the past.
  • Broken interfaces are well supported now (if you did alsoProvides with them).
0.3 (2010-02-02)
  • Unplickle and re-pickle the code to rename references to moved classes. This make the script works on database created with older versions of ZODB.
  • If you are working directly with a FileStorage, POSKeyError are reported but non-fatal.
  • Remove superfluous code that tried to prevent commits when no changes happened: ZODB does this all by itself already.
0.2 (2009-06-23)
  • Add option to store the rename rules into a file.
  • Don't commit transactions that have no changes.
  • Load rename rules from entry points zodbupdate.
  • Compatibility with Python 2.4
  • Rename from zodbupgrade to zodbupdate.
  • Add 'verbose' option.
  • Improve logging.
  • Suppress duplicate log messages (e.g. if the same class is missing in multiple objects).
  • Improve the updating process: rewrite pickle opcodes instead of blindly touching a class. This also allows updating pickles that can't be unpickled due to missing classes.
0.1 (2009-06-08)
  • First release.

Subscribe to package updates

Last updated Jan 5th, 2011

Download Stats

Last month:9

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.