Skip to main content

Universal Database Migration Tool - Migrate any database to any database across 74 databases and 9 paradigms

Project description

DBMigrate - Universal Database Migration Tool

Migrate any database to any database. Any paradigm to any paradigm. Powered by AI.

The Problem

Database migrations cost companies $50,000 - $500,000+ because:

  • Schema differences require manual mapping
  • Stored procedures need complete rewrites (PL/SQL → PL/pgSQL)
  • Data type incompatibilities cause data loss
  • Cross-paradigm migrations (SQL → NoSQL) are near-impossible manually
  • Consultants charge $200-400/hour

The Solution

DBMigrate automates 90% of the migration work across 60+ databases and 9 paradigms:

                               ┌──── PostgreSQL
Oracle ────────┐               ├──── MongoDB
SQL Server ────┤               ├──── Neo4j
MongoDB ───────┤  ┌─────────┐  ├──── Elasticsearch
Neo4j ─────────┼─►│DBMigrate│─►├──── Pinecone
Redis ─────────┤  │AI Engine│  ├──── Cassandra
Elasticsearch ─┤  └─────────┘  ├──── InfluxDB
InfluxDB ──────┤               ├──── Redis
Pinecone ──────┘               └──── Any Target

Features

  • Multi-Paradigm Support: Relational, Document, Graph, Vector, Time-Series, Key-Value, Columnar, Search
  • Cross-Paradigm Transformation: SQL → Document, Graph → Relational, and more
  • Schema Extraction: Connect to 60+ databases, extract complete schema
  • Intelligent Type Mapping: 500+ data type conversions with edge case handling
  • AI-Powered SP Conversion: Stored procedures translated using latest LLM models
  • Trigger Migration: Automatic trigger syntax conversion
  • View Translation: Query syntax adapted to target dialect
  • Compatibility Analysis: Automatic assessment of migration complexity and data loss risks

Quick Start

CLI Usage

# Install
pip install dbmigrate

# Migrate PostgreSQL to MySQL
dbmigrate --source postgresql --target mysql \
          --source-conn "postgresql://user:pass@localhost/mydb" \
          --output ./migration

# Migrate Oracle to PostgreSQL (the hard one!)
dbmigrate --source oracle --target postgresql \
          --source-conn "oracle://user:pass@localhost/ORCL" \
          --output ./migration

API Usage

from dbmigrate import migrate

report = migrate(
    source_type="oracle",
    target_type="postgresql",
    source_connection="oracle://user:pass@localhost/ORCL",
    output_dir="./migration"
)

print(f"Migrated {report.tables_migrated} tables")
print(f"Converted {report.procedures_converted} stored procedures")

REST API (SaaS)

# Start API server
dbmigrate-api --port 8000

# Create migration job
curl -X POST http://localhost:8000/api/v1/migrations \
  -H "Content-Type: application/json" \
  -d '{
    "source_type": "oracle",
    "target_type": "postgresql",
    "source_connection": "oracle://..."
  }'

# Convert SQL instantly
curl -X POST http://localhost:8000/api/v1/convert/sql \
  -H "Content-Type: application/json" \
  -d '{
    "source_type": "oracle",
    "target_type": "postgresql",
    "sql_code": "SELECT NVL(col, 0) FROM dual WHERE ROWNUM < 10"
  }'

Supported Databases (60+)

🗄️ Relational (SQL)

Database Extract Generate SP Convert Driver
PostgreSQL psycopg2
MySQL/MariaDB mysql-connector
Oracle oracledb
SQL Server pyodbc
SQLite N/A built-in
Azure SQL pyodbc
DB2 ibm-db
SAP HANA hdbcli
Snowflake snowflake-connector
Aurora psycopg2/mysql-connector
Cloud SQL driver per dialect
CockroachDB psycopg2
YugabyteDB psycopg2
TiDB mysql-connector
VoltDB voltdb-client
SingleStore mysql-connector

📄 Document (NoSQL)

Database Extract Generate Transform Driver
MongoDB pymongo
CouchDB couchdb
Couchbase couchbase
AWS DocumentDB pymongo
Cosmos DB azure-cosmos
Firestore google-cloud-firestore
FaunaDB faunadb
SurrealDB surrealdb

🕸️ Graph

Database Extract Generate Transform Driver
Neo4j neo4j
Amazon Neptune gremlinpython
ArangoDB python-arango
JanusGraph gremlinpython
Dgraph pydgraph
TigerGraph pyTigerGraph

🎯 Vector

Database Extract Generate Transform Driver
Pinecone pinecone-client
Milvus pymilvus
Weaviate weaviate-client
Vespa pyvespa
Qdrant qdrant-client
Chroma chromadb
pgvector psycopg2

⏱️ Time-Series

Database Extract Generate Transform Driver
InfluxDB influxdb-client
TimescaleDB psycopg2
Prometheus prometheus-client
OpenTSDB requests
VictoriaMetrics requests
QuestDB psycopg2

🔑 Key-Value

Database Extract Generate Transform Driver
Redis redis
Memcached pymemcache
DynamoDB boto3
Riak riak
Aerospike aerospike
KeyDB redis
Etcd etcd3
FoundationDB foundationdb

📊 Wide-Column / Columnar

Database Extract Generate Transform Driver
Cassandra cassandra-driver
HBase happybase
ScyllaDB cassandra-driver
Bigtable google-cloud-bigtable
ClickHouse clickhouse-connect
Redshift redshift-connector
BigQuery google-cloud-bigquery
Druid pydruid

🔍 Search / Analytics

Database Extract Generate Transform Driver
Elasticsearch elasticsearch
OpenSearch opensearch-py
Solr pysolr
Splunk splunk-sdk
Typesense typesense
MeiliSearch meilisearch

💾 Embedded

Database Extract Generate Transform Driver
RocksDB python-rocksdb
LevelDB plyvel
DuckDB duckdb
Berkeley DB bsddb3

Cross-Paradigm Transformations

DBMigrate can intelligently transform schemas between different database paradigms:

From → To Supported Notes
Relational → Document Embeds related tables, denormalizes JOINs
Relational → Graph FKs become edges, junction tables become relationships
Document → Relational Normalizes nested objects, arrays become child tables
Document → Graph References become edges, embedded docs become connected nodes
Graph → Document Aggregates connected nodes, edges become references
Graph → Relational Nodes become tables, edges become junction tables

Transformation Strategies

from dbmigrate.transformers import CrossParadigmTransformer, EmbeddingStrategy

transformer = CrossParadigmTransformer()

# SQL to MongoDB - embed small related tables, normalize large ones
result = transformer.transform(
    source_schema,
    target_paradigm=ParadigmType.DOCUMENT,
    embedding_strategy=EmbeddingStrategy.HYBRID
)

# MongoDB to PostgreSQL - full normalization
result = transformer.transform(
    source_schema,
    target_paradigm=ParadigmType.RELATIONAL,
    normalization_strategy=NormalizationStrategy.FULL
)

Database-Specific Extraction Features

Oracle

  • Tables with columns, indexes, foreign keys, primary keys
  • Column comments and table comments
  • Views with definitions
  • Stored procedures and functions (PL/SQL source)
  • Packages (spec and body)
  • Triggers with timing, events, and body
  • Sequences with current value for seamless continuation

SQL Server

  • Full schema.table support (dbo, custom schemas)
  • VARCHAR(MAX), NVARCHAR(MAX), VARBINARY(MAX) handling
  • IDENTITY columns with seed/increment
  • Computed columns
  • Extended properties (MS_Description)
  • T-SQL stored procedures and functions
  • Scalar, inline table-valued, and multi-statement functions
  • INSTEAD OF triggers
  • Sequences (SQL Server 2012+)

MongoDB

  • Collection schema inference from sample documents
  • JSON Schema validators
  • Index definitions (single, compound, text, geospatial)
  • Validation rules and levels
  • Capped collection settings

Neo4j

  • Node labels and properties
  • Edge types with cardinality
  • Indexes and constraints
  • Property type inference
  • APOC procedure detection

Elasticsearch

  • Index mappings and settings
  • Field types and analyzers
  • Index templates and aliases
  • Ingest pipelines

Redis

  • Key pattern analysis
  • TTL configurations
  • Data structure detection (hash, set, list, sorted set)
  • Cluster configuration

Architecture

┌─────────────────────────────────────────────────────────────────────────┐
│                            DBMigrate                                    │
├─────────────────────────────────────────────────────────────────────────┤
│                                                                         │
│  ┌──────────────┐    ┌──────────────┐    ┌────────────────┐            │
│  │  Extractors  │───►│  Universal   │───►│   Generators   │            │
│  │  (60+ DBs)   │    │   Schemas    │    │   (60+ DBs)    │            │
│  └──────────────┘    └──────────────┘    └────────────────┘            │
│         │                   │                    │                      │
│         ▼                   ▼                    ▼                      │
│  ┌──────────────┐    ┌──────────────┐    ┌────────────────┐            │
│  │   Paradigms  │    │ Transformers │    │  Type Mappers  │            │
│  │  • Relational│    │ Cross-Paradigm│   │  500+ types    │            │
│  │  • Document  │    │ SQL↔Document │    └────────────────┘            │
│  │  • Graph     │    │ SQL↔Graph   │                                   │
│  │  • Vector    │    │ Doc↔Graph   │    ┌────────────────┐            │
│  │  • TimeSeries│    └──────────────┘    │  SP Converter  │            │
│  │  • KeyValue  │                        │   (AI/LLM)     │            │
│  │  • Columnar  │                        └────────────────┘            │
│  │  • Search    │                                                       │
│  └──────────────┘                                                       │
│                                                                         │
└─────────────────────────────────────────────────────────────────────────┘

Component Overview

  • Extractors: Connect to source databases and extract schema metadata
  • Paradigms: Unified schema representations for each database category
  • Transformers: Convert schemas between paradigms (SQL↔NoSQL, etc.)
  • Generators: Generate DDL/schema definitions for target databases
  • Type Mappers: Handle 500+ data type conversions with edge cases
  • SP Converter: AI-powered stored procedure translation

Pricing (SaaS)

Plan Tables/Month SP Conversions Price
Starter 50 20 $99/mo
Pro 500 200 $499/mo
Enterprise Unlimited Unlimited $2,499/mo

Compare to consultants: $50,000+ per migration project

Output Files

After running a migration, you get:

migration_output/
├── schema.sql              # Complete DDL for target database
├── stored_procedures.sql   # Converted stored procedures
├── triggers.sql            # Converted triggers
├── data_migration_guide.md # Instructions for data transfer
└── migration_report.json   # Detailed report

Requirements

  • Python 3.11+
  • Database drivers (installed per paradigm or individually)
  • Anthropic API key (for SP conversion) - uses Claude Sonnet

Installation

# Basic install (CLI only)
pip install dbmigrate

# Install by individual database
pip install dbmigrate[postgresql]        # PostgreSQL
pip install dbmigrate[mysql]             # MySQL/MariaDB
pip install dbmigrate[oracle]            # Oracle Database
pip install dbmigrate[sqlserver]         # SQL Server (requires ODBC driver)
pip install dbmigrate[mongodb]           # MongoDB
pip install dbmigrate[neo4j]             # Neo4j
pip install dbmigrate[redis]             # Redis
pip install dbmigrate[elasticsearch]     # Elasticsearch
pip install dbmigrate[pinecone]          # Pinecone
pip install dbmigrate[influxdb]          # InfluxDB

# Install by paradigm (all databases in category)
pip install dbmigrate[relational-all]    # All relational databases
pip install dbmigrate[document-all]      # MongoDB, Couchbase, Firestore, etc.
pip install dbmigrate[graph-all]         # Neo4j, ArangoDB, etc.
pip install dbmigrate[vector-all]        # Pinecone, Milvus, Weaviate, etc.
pip install dbmigrate[timeseries-all]    # InfluxDB, TimescaleDB, etc.
pip install dbmigrate[keyvalue-all]      # Redis, DynamoDB, Memcached, etc.
pip install dbmigrate[columnar-all]      # Cassandra, ClickHouse, BigQuery, etc.
pip install dbmigrate[search-all]        # Elasticsearch, OpenSearch, Solr, etc.

# Bundles
pip install dbmigrate[enterprise]        # Common production databases
pip install dbmigrate[all]               # Every supported database

# With REST API server
pip install dbmigrate[api]

# Full install (all features)
pip install dbmigrate[all,api]

# Development
git clone https://github.com/yourcompany/dbmigrate
cd dbmigrate
pip install -e ".[dev,all,api]"

SQL Server ODBC Driver

SQL Server requires the Microsoft ODBC driver:

# Windows (usually pre-installed with SQL Server tools)
# Download: https://docs.microsoft.com/en-us/sql/connect/odbc/download-odbc-driver-for-sql-server

# Linux (Ubuntu/Debian)
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list > /etc/apt/sources.list.d/mssql-release.list
apt-get update
ACCEPT_EULA=Y apt-get install -y msodbcsql17

# macOS
brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release
brew update
HOMEBREW_NO_ENV_FILTERING=1 ACCEPT_EULA=Y brew install msodbcsql17

License

Commercial license required for production use. Free for evaluation and development.


🏢 Enterprise Features

DBMigrate Enterprise Edition includes advanced capabilities for mission-critical migrations:

⚡ High-Performance Parallel Processing

Migrate billions of rows efficiently with intelligent scaling:

from dbmigrate.core.parallel import ParallelMigrationEngine, ScalingConfig, ScalingMode

# Auto-detect optimal configuration
config = ScalingConfig(
    mode=ScalingMode.HYBRID,      # Threads + Processes
    max_workers=0,                 # Auto-detect from CPU
    batch_size=50000,              # Rows per batch
    adaptive_batching=True,        # Auto-tune batch size
    use_server_cursors=True,       # Memory-efficient streaming
)

engine = ParallelMigrationEngine(config)
engine.migrate_tables(['users', 'orders', 'transactions'])

Scaling Modes:

  • SINGLE - Debug mode
  • THREADED - Best for I/O bound (network, disk)
  • PROCESS - Best for CPU bound (transforms, compression)
  • HYBRID - Processes with internal threads
  • DISTRIBUTED - Redis-based horizontal scaling

🌐 Distributed Processing (Horizontal Scaling)

Scale across multiple servers with Redis-based coordination:

from dbmigrate.core.distributed import DistributedMigrationCoordinator

coordinator = DistributedMigrationCoordinator(
    redis_host='redis-cluster.internal',
    redis_port=6379,
    num_workers=10  # Across multiple servers
)

# Start workers on each server
coordinator.start_worker(worker_id='worker-001')

# Submit migration job
job_id = coordinator.submit_migration(
    source_conn='postgresql://source/db',
    target_conn='postgresql://target/db',
    tables=['users', 'orders', 'products'],
    priority='high'
)

# Monitor progress
status = coordinator.get_job_status(job_id)
print(f"Progress: {status['progress']}%")

🔒 Data Masking & PII Anonymization

GDPR, HIPAA, PCI-DSS compliant data masking:

from dbmigrate.core.masking import DataMaskingEngine, MaskingRule, MaskingStrategy

engine = DataMaskingEngine(deterministic=True)  # Preserve FK relationships

# Configure masking rules
engine.add_rule(MaskingRule('email', MaskingStrategy.HASH))
engine.add_rule(MaskingRule('ssn', MaskingStrategy.REDACT))
engine.add_rule(MaskingRule('salary', MaskingStrategy.RANGE, range_bucket_size=10000))
engine.add_rule(MaskingRule('dob', MaskingStrategy.DATE_SHIFT, date_shift_days=30))
engine.add_rule(MaskingRule('name', MaskingStrategy.FAKE))  # Realistic fake names
engine.add_rule(MaskingRule('phone', MaskingStrategy.MASK_PARTIAL, partial_mask_end=4))

# Or use compliance presets
engine = DataMaskingEngine.create_gdpr_compliant()
engine = DataMaskingEngine.create_hipaa_compliant()
engine = DataMaskingEngine.create_pci_compliant()

# Mask during migration
masked_row = engine.mask_row(original_row)

Masking Strategies:

Strategy Example Input Example Output
REDACT 123-45-6789 *********
HASH john@example.com a1b2c3d4...
FAKE John Doe Michael Smith
PARTIAL 4111111111111111 ************1111
DATE_SHIFT 1990-03-15 1990-02-28
RANGE 75000 70000-80000
NULL any value NULL

📡 Real-Time WebSocket Progress

Monitor migrations in real-time via WebSocket:

from dbmigrate.core.websocket import FlaskWebSocketServer

# Server setup
server = FlaskWebSocketServer(app)
server.start()

# Client-side JavaScript
const ws = new WebSocket('ws://localhost:5050/ws/progress');
ws.onmessage = (event) => {
    const progress = JSON.parse(event.data);
    console.log(`Table: ${progress.table}`);
    console.log(`Progress: ${progress.percentage}%`);
    console.log(`Rows/sec: ${progress.rows_per_second}`);
    console.log(`ETA: ${progress.eta_seconds}s`);
};

🔬 Advanced Schema Extraction

Extract enterprise-specific schema objects:

from dbmigrate.extractors.advanced import (
    PostgreSQLAdvancedMixin,
    SQLServerAdvancedMixin,
    OracleAdvancedMixin,
)

# Extract PostgreSQL-specific objects
pg_extractor = PostgreSQLAdvancedExtractor(connection)
extensions = pg_extractor.extract_extensions()  # uuid-ossp, pgcrypto, etc.
materialized_views = pg_extractor.extract_materialized_views()
check_constraints = pg_extractor.extract_check_constraints()

# Extract SQL Server computed columns
ss_extractor = SQLServerAdvancedExtractor(connection)
computed_columns = ss_extractor.extract_computed_columns()

# Extract Oracle partitions
ora_extractor = OracleAdvancedExtractor(connection)
partitions = ora_extractor.extract_partitions()

🌙 Dark Mode UI

Modern enterprise dashboard with dark mode support:

  • Automatic theme detection from system preferences
  • Toggle with persistent localStorage storage
  • Smooth CSS transitions

🧪 Testing

DBMigrate includes a comprehensive testing suite:

Running Tests

# All tests
pytest tests/ -v

# Unit tests only
pytest tests/ -v -m unit

# Integration tests only
pytest tests/ -v -m integration

# Specific test files
pytest tests/test_masking.py -v
pytest tests/test_parallel.py -v
pytest tests/test_type_mapper.py -v
pytest tests/test_integration.py -v

# With coverage
pytest tests/ --cov=dbmigrate --cov-report=html

RL-Based Automated Test Agent 🤖

DBMigrate includes an innovative Reinforcement Learning test agent that automatically explores and tests all features:

# Run RL test agent
python tests/rl_test_agent.py

# Or with custom episodes
python -c "from tests.rl_test_agent import run_rl_tests; run_rl_tests(episodes=100)"

Features:

  • Q-Learning based exploration
  • Automatic edge case discovery
  • Coverage-guided testing
  • Regression detection
  • Property-based test generation

Sample Output:

============================================================
RL TEST AGENT REPORT
============================================================
Episodes Run: 100
Total Reward: 487.50
Average Reward: 4.88
Feature Coverage: 85.7%
Regressions Found: 0
Unique Errors Found: 2

ACTION COVERAGE:
  CREATE_SQLITE_SOURCE              ████████████████████ (100)
  CREATE_SIMPLE_TABLE               ██████████████████ (92)
  INSERT_SMALL_DATASET              ████████████████ (81)
  MIGRATE_SINGLE_TABLE              ██████████████ (73)
  VALIDATE_ROW_COUNT                ████████████ (65)
  ...

Test Categories

Category Description Run Command
Unit Individual component tests pytest -m unit
Integration End-to-end workflows pytest -m integration
Slow Performance/stress tests pytest -m slow
Database-specific Requires real DB pytest -m postgres

Support

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

dbmigrate_pro-1.0.0.tar.gz (1.7 MB view details)

Uploaded Source

Built Distribution

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

dbmigrate_pro-1.0.0-py3-none-any.whl (322.1 kB view details)

Uploaded Python 3

File details

Details for the file dbmigrate_pro-1.0.0.tar.gz.

File metadata

  • Download URL: dbmigrate_pro-1.0.0.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for dbmigrate_pro-1.0.0.tar.gz
Algorithm Hash digest
SHA256 bf50b3df74d5fdc3196ff495468b2621bc8c7190d5647fa22a6eaea04fa52754
MD5 bd9a3a5fac5697a589bbd2973011ef20
BLAKE2b-256 a7a54a5fdb703a9057e0a6f8d2b11f70f54213e78f23e509184c8a10ab1ba6c9

See more details on using hashes here.

File details

Details for the file dbmigrate_pro-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: dbmigrate_pro-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 322.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for dbmigrate_pro-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d5e3004c2d9c2b4537c7aa2613398295b44b912007ef41930026ab61ec6f715e
MD5 b3d08e2060d3ec06de71177de7108f12
BLAKE2b-256 f2755bd9afe38bc035f62f7a20674c9dca1647c1547a122c1e329df13e9b492a

See more details on using hashes here.

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