Skip to main content

Generic ZODB storage conversion tool

Project description

zodb-convert

Generic ZODB storage conversion tool. Copies data between any two ZODB-compatible storages.

Derived from RelStorage's zodbconvert by the Zope Foundation and Contributors, extracted as a standalone generic tool.

Installation

pip install zodb-convert

To convert between specific storage types, install their packages too:

pip install zodb-convert ZODB RelStorage  # FileStorage ↔ RelStorage
pip install zodb-convert ZODB zodb-pgjsonb  # FileStorage ↔ PGJsonb

Usage

Traditional config file

Create a config file (convert.conf):

<filestorage source>
    path /data/Data.fs
    blob-dir /data/blobs
</filestorage>

<filestorage destination>
    path /backup/Data.fs
    blob-dir /backup/blobs
</filestorage>

For storages that need blob wrapping:

<blobstorage source>
    blob-dir /data/blobs
    <filestorage>
        path /data/Data.fs
    </filestorage>
</blobstorage>

<filestorage destination>
    path /backup/Data.fs
    blob-dir /backup/blobs
</filestorage>

For third-party storages, use %import:

%import relstorage

<relstorage source>
    <postgresql>
        dsn dbname=zodb user=zodb
    </postgresql>
</relstorage>

<filestorage destination>
    path /backup/Data.fs
</filestorage>

Run:

zodb-convert convert.conf

Using existing zope.conf files

Extract storage configuration directly from Zope config files:

zodb-convert --source-zope-conf /old/etc/zope.conf --dest-zope-conf /new/etc/zope.conf

Specify which database to use (defaults to "main"):

zodb-convert --source-zope-conf zope.conf --source-db main \
             --dest-zope-conf other.conf --dest-db catalog

Mixed mode

Combine traditional config with zope.conf extraction:

zodb-convert convert.conf --source-zope-conf /old/etc/zope.conf

Where convert.conf contains only the destination storage section.

Options

  • --dry-run — show what would be copied without making changes
  • --incremental — resume from the last transaction in the destination
  • -w N / --workers N — number of parallel writer threads (default: 1)
  • --background-blobs — upload blobs to S3 in a background thread pool, decoupled from PG writes (faster for large migrations)
  • --deferred-blobs PATH — write blob upload tasks to a manifest file instead of uploading during migration
  • --upload-blobs MANIFEST — upload deferred blobs from a manifest file (created by --deferred-blobs)
  • -v / --verbose — increase verbosity (-v for INFO, -vv for DEBUG)

Source Code and Contributions

The source code is managed in a Git repository, with its main branches hosted on GitHub. Issues can be reported there too.

We'd be happy to see many forks and pull requests to make this package even better. We welcome AI-assisted contributions, but expect every contributor to fully understand and be able to explain the code they submit. Please don't send bulk auto-generated pull requests.

Maintainers are Jens Klein and the BlueDynamics Alliance developer team. We appreciate any contribution and if a release on PyPI is needed, please just contact one of us. We also offer commercial support if any training, coaching, integration or adaptations are needed.

License

ZPL-2.1 — see LICENSE.txt

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zodb_convert-1.0.0b11.tar.gz (52.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zodb_convert-1.0.0b11-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

Details for the file zodb_convert-1.0.0b11.tar.gz.

File metadata

  • Download URL: zodb_convert-1.0.0b11.tar.gz
  • Upload date:
  • Size: 52.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for zodb_convert-1.0.0b11.tar.gz
Algorithm Hash digest
SHA256 a887f6c22031fb3eb97ab27e077007c8a89b1970d32bd85651fca7a26c99cfd5
MD5 54adff7911186ed8c3994eff826ca8d3
BLAKE2b-256 d6c89e726ddcb503199ca37cfbe975ee51a4c18493f0a972855a6fe9287373d4

See more details on using hashes here.

Provenance

The following attestation bundles were made for zodb_convert-1.0.0b11.tar.gz:

Publisher: release.yaml on bluedynamics/zodb-convert

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zodb_convert-1.0.0b11-py3-none-any.whl.

File metadata

File hashes

Hashes for zodb_convert-1.0.0b11-py3-none-any.whl
Algorithm Hash digest
SHA256 87b6a52814a0acd4d3ab0419967e5cabf2e308f9e1faeb720c485f295e468d67
MD5 227a11b795a2f20256b083e700191e92
BLAKE2b-256 6204392aef564efe8b866ad2fe03a4afc1efa329a0e3a635544514bdec3b2283

See more details on using hashes here.

Provenance

The following attestation bundles were made for zodb_convert-1.0.0b11-py3-none-any.whl:

Publisher: release.yaml on bluedynamics/zodb-convert

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page