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.



subject:
  ( 11 subscribers )