Skip to main content

omnidbm — universal database-to-database transfer engine

PyPI version Python versions License Downloads Wheel


omnidbm moves data between any supported database and any other. MongoDB, PostgreSQL, MySQL, SQLite, Redis, CSV, JSONL — pick a source, pick a destination, transfer. One package, one CLI, one lossless data bus.

Features

  • Any-to-any transfers — every connector speaks both directions; no source/destination pairing limits
  • Lossless type bus — datetimes, ObjectIds, Binary, and Decimals survive round trips via JSON-safe type tags
  • Zero hardcoding — everything is configured per-run with CLI flags; nothing is baked in
  • Automatic schema — PostgreSQL, MySQL, and SQLite destinations are created and typed for you
  • Interactive wizard — guided setup for every supported database
  • Preflight checks — doctor verifies connectivity before you start
  • Battle-tested basics — batch size, per-table limits, filters, drop-first, conflict policies, dry runs, index copy

Install

pip install omnidbm

pip install "omnidbm[mysql]"   # MySQL support
pip install "omnidbm[redis]"   # Redis support
pip install "omnidbm[all]"     # everything

Requires Python 3.10+. MongoDB (pymongo) and PostgreSQL (psycopg) drivers are included; MySQL and Redis drivers are optional extras.

Quick start

# Transfer every table, schema included
omnidbm transfer -s mongodb://user:pass@host:27017/db -d postgresql://user:pass@host:5432/db

# Selective: specific tables, bigger batches, wipe the destination first
omnidbm transfer -s mongodb://... -d postgresql://... -t users,orders --batch-size 2000 --drop-first

# Dry run: count only, no writes
omnidbm transfer -s csv://./data -d mongodb://... --dry-run

# Guided interactive setup
omnidbm wizard

# Inspect a source before moving anything
omnidbm inspect mongodb://user:pass@host:27017/db --sample 3

# Connectivity preflight
omnidbm doctor mongodb://... postgresql://...

Options

Flag Description
-s, --source Source URI
-d, --dest Destination URI
-t, --tables Comma-separated tables (default: all)
--batch-size Documents per batch (default 1000)
--drop-first Drop destination table before transferring
--dry-run Count documents only, no writes
--limit Max documents per table
--filter Source-side JSON filter, e.g. {"status":"active"}
--conflict skip (default), overwrite, or error
--copy-indexes Copy indexes (MongoDB only)
--copy-options Copy collection options (MongoDB only)

URI schemes

Scheme Example
MongoDB mongodb://user:pass@host:27017/db · mongodb+srv://...
PostgreSQL postgresql://user:pass@host:5432/db
MySQL mysql://user:pass@host:3306/db
SQLite sqlite://C:/path/db.sqlite · sqlite://:memory:
Redis redis://user:pass@host:6379/0
CSV csv://C:/path/file.csv · csv://C:/data/ (directory = multiple tables)
JSONL jsonl://C:/path/out.jsonl · jsonl://C:/data/

Redis treats key prefixes (split on :) as tables; (all) targets every key. Documents use the shape {"_key", "_value", "_ttl"} and support strings, hashes, lists, and sets.

Python API

from omnidbm import transfer, TransferConfig, ConnectorConfig, TableSpec

config = TransferConfig(
    source=ConnectorConfig(uri="mongodb://user:pass@host:27017/db"),
    dest=ConnectorConfig(uri="postgresql://user:pass@host:5432/db"),
    tables=[TableSpec(source="users", dest="users")],
    drop_first=True,
)
results = transfer(config)

Custom connectors

Subclass BaseConnector, implement connect, list_tables, read_stream, write_stream, and close, then register:

from omnidbm.core.connector import BaseConnector, register


@register("myproto")
class MyConnector(BaseConnector): ...

How the type bus works

Every document is normalized to JSON-safe values on the wire, tagged so nothing is lost in transit:

Type Tag
datetime {"$omni:datetime": "2026-08-17T12:00:00+00:00"}
ObjectId {"$omni:objectid": "507f1f77bcf86cd799439011"}
Binary {"$omni:binary": "<base64>"}
Decimal {"$omni:decimal": "99.95"}

Development

git clone https://github.com/Notookk/Omnidbm
pip install -e ".[dev]"

pytest          # run the test suite
ruff check .    # lint
ruff format .   # format

Roadmap

  • Resumable transfers with checkpoints
  • Saved config profiles
  • Parallel table transfers
  • Incremental / delta sync

License

MIT — see LICENSE.

Release files for omnidbm 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for omnidbm 0.1.1
File Size Uploaded
omnidbm-0.1.1.tar.gz 25.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for omnidbm 0.1.1
File Interpreter ABI Platform
omnidbm-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 52.8 kB

Release files / omnidbm-0.1.1.tar.gz

Download URL omnidbm-0.1.1.tar.gz
Size 25.6 kB
Tags Source
SHA-256 checksum
How to use checksums
18c0ad82deff503a0e89bcb3356af2501445a3423712e438152b422db98516c1
BLAKE2b-256 checksum
How to use checksums
aece789f637198e39f3c0c525b346994a311ea8212e688df76cc23797fb61c12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.2

Release files / omnidbm-0.1.1-py3-none-any.whl

Download URL omnidbm-0.1.1-py3-none-any.whl
Size 27.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a943edfdb74b3e7f51007c01fffac928065f4cc86eb5df00e01dc7c4be8a62f8
BLAKE2b-256 checksum
How to use checksums
e3cf83f1cec2eafa82f283d8f70c1ccba823f4fbb695804c8f3ae930e7e30f32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.2

Release history Release notifications | RSS feed

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page