home contents changes options help subscribe edit (external edit)

Overview

ZODBConvert is a ZODB storage conversion utility that comes with RelStorage. Use it to copy the entire state of a storage into a different storage. It works with any storage that implements the storage iterator protocol (including FileStorage, RelStorage, and perhaps others). It preserves all objects and transactions, meaning that you can still use the ZODB undo feature after the conversion, and you can convert back using the same process in reverse.

How to use it

Create a configuration file that specifies two storages, one named "source", the other "destination". The configuration file format is very much like zope.conf (both are parsed using ZConfig?). Then run zodbconvert.py, providing the name of the configuration file as a parameter.

The utility does not modify the source storage. Before copying the data, the utility verifies the destination storage is completely empty. If the destination storage is not empty, the utility aborts without making any changes to the destination. (Copying transactions into an already populated database is complex and outside the scope of this utility.)

Here is a sample configuration file:

<filestorage source>
  path /zope/var/Data.fs
</filestorage>

<relstorage destination>
  <mysql>
    db zodb
  </mysql>
</relstorage>

This configuration file specifies that the utility should copy all of the transactions from Data.fs to a MySQL database called "zodb". If you want to reverse the conversion, exchange the names "source" and "destination". All storage types and storage parameters available in zope.conf are also available in this configuration file.

Options

--clear: Clears all data from the destination storage before copying. Use this only if you're certain the destination has no useful data.

--dry-run: Opens both storages and analyzes what would be copied, but does not actually copy.

--verbose: List the transactions and objects as they are copied. This is very verbose.

zodbconvert....doesnt' so much. --Paul Fiero, Wed, 04 Feb 2009 13:28:39 -0500 reply

When attempting to use zodbconvert to go from a Data.fs file to a MySQL database I get the following error: ZConfig?.SchemaResourceError?: import name does not refer to a package

Package name: 'relstorage' File name: 'component.xml' Package path: None

I am using Python 2.4.4 and Zope 2.10. Has anyone actually gotten zodbconvert to work "out of the box" or am I fighting an uphill battle by trying to use it?

If you can assist please e-mail me at: <span class="nospam1">&#112aul.fiero<!-- foobar --></span>&#64;<span class="nospam2">ci.austin.t&#120;&#46;us</span>

Misconfigured somehow --Shane Hathaway, Thu, 19 Feb 2009 16:03:19 -0500 reply

Paul, your environment is somehow misconfigured so that the zodbconvert script runner can't find the relstorage package. I know others have used zodbconvert successfully. Perhaps you've tripped over some packaging bug.

same error with zope 2.12.0a4 (easy_installed) --T5, Mon, 04 May 2009 07:11:42 -0400 reply

same error here, though the python interpreter in my virtualenv can import relstorage just fine: (zope)[jh@t5-laptop zope]?$ ./bin/python Python 2.4.4 (#1, Aug 8 2007, 09:54:51) [GCC 4.1.2 20070302 (prerelease) (4.1.2-1mdv2007.1)]? on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import relstorage >>>

any hints?



subject:
  ( 13 subscribers )