Skip to main content

Py-Auto-Migrate

The Universal Database Migration Tool
Seamlessly transfer data between any database.

PyPI - Version GitHub Repo Stars License Latest Release


Why Py-Auto-Migrate?

Migrating data between different database systems is often a tedious and error-prone task. Py-Auto-Migrate is here to change that. It's a powerful, flexible, and easy-to-use Python tool that automates the entire process.

  • Universal Connector: Supports a vast range of databases, from SQL to NoSQL.
  • Zero Configuration: Point to your source and target, and let the tool handle schema detection, data type mapping, and destination creation.
  • Blazing Fast: Optimized for performance, even with large datasets.
  • Safe & Reliable: Built-in checks ensure data integrity throughout the migration.

Installation

Get started in seconds with pip.

pip install py-auto-migrate

Prefer a Standalone Shell?

Don't have Python? No problem! Download the dedicated PAM-Shell for your OS from the Releases page. It's a ready-to-run executable with the same powerful features.


Quick Start

Using Py-Auto-Migrate is as simple as running one command.

Basic Command Structure

py-auto-migrate migrate --source <SOURCE_URI> --target <TARGET_URI>
Argument Description
--source Required. Connection URI for the source database.
--target Required. Connection URI for the target database.
--table Optional. Migrate a specific table. If omitted, all data is migrated.
--ai-ask Optional. Natural language query for AI-powered.
--ai-model Optional. OpenAI model (default: gpt-3.5-turbo).
--dep Optional. Table forigen key dependency.
--pgbar Optional. Show row-based migration progress in the terminal.
--skip-existing Optional. Skip source rows already present in the target. Disabled by default.

Examples

1. Migrate an entire database from MongoDB to MySQL:

py-auto-migrate migrate \
  --source "mongodb://user:pass@localhost:27017/source_db" \
  --target "mysql://user:pass@localhost:3306/target_db" \
  --pgbar \
  --skip-existing

--pgbar prints row-level progress while the command runs. --skip-existing checks destination rows and submits only source rows that are not already there; it is disabled by default. See the note below for how duplicate source rows are handled.

2. Migrate a single PostgreSQL table to a new MongoDB collection:

py-auto-migrate migrate \
  --source "postgresql://user:pass@localhost:5432/mydb" \
  --target "mongodb://user:pass@localhost:27017/mydb" \
  --table users

The Magic: If the target database or table doesn't exist, Py-Auto-Migrate automatically creates it for you! It intelligently maps source data types to the appropriate target schema.

By default, migration appends every source row, including duplicate rows. Use --skip-existing to skip only copies already present in the target. This is a row-content comparison, so it may read the existing target table into memory. Duplicate rows in the source are preserved according to their count: if the source has two identical rows and the target has one, one row is added. Without --skip-existing, running the same migration again appends the rows again.

3. Query using AI (Target must be a relational database):

export OPENAI_API_KEY="your-api-key"

Before using AI, make sure the OPENAI_API_KEY has been exported.

py-auto-migrate migrate \
  --source "oracle://user:password@host:port/service_name" \
  --target "mssql://user:password@host:port/database" \ 
  --ai-ask "Please select and insert only names that start with 'S', then sort them." /
  --ai-model "gpt-3.5-turbo"

4. Migrate table forigen key dependency (Source must be a relational database):

py-auto-migrate migrate \
  --source "postgresql://user:pass@localhost:5432/mydb" \
  --target "mongodb://user:pass@localhost:27017/mydb" \
  --table orders \
  --dep

--dep automatically adds all tables referenced by foreign key relationships from the source table to the insertion list.


Dashboard

For an even easier and more visual migration experience, Py-Auto-Migrate includes a dedicated web dashboard.

Usage:

py-auto-migrate dashboard

Default Dashboard URL:

http://localhost:8123

or :

py-auto-migrate dashboard --host "localhost" --port 8000

Features:

  • Visual Interface – No need to memorize commands or URIs
  • Connection Builder – Easily build source/target URIs with form inputs
  • Table Selection – Choose specific tables or migrate all with checkboxes
  • Real-time Logs – Watch migration progress and errors live
  • AI Query UI – Use natural language queries with a simple text box
  • Job Management – Run, monitor, and manage multiple migration jobs
  • One-Click Migrate – Start migrations with a single button click

The dashboard skips rows already present in the target by default and writes each table in one call to avoid the overhead of progress-driven write batches. Uncheck the option to append every source row. Progress updates advance after each table write completes.


Supported Databases

We support a wide and growing range of databases.

Category Databases
Relational MySQL PostgreSQL Oracle SQL Server MariaDB SQLite
NoSQL MongoDB Redis DynamoDB Elasticsearch
Analysis ClickHouse

Have a feature request? Open an issue and let us know!

Metadata

Release files for py-auto-migrate 0.8.3

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

Source distribution (sdist)

Source distribution for py-auto-migrate 0.8.3
File Size Uploaded Provenance Actions
py_auto_migrate-0.8.3.tar.gz 45.6 kB Without provenance Details for py_auto_migrate-0.8.3.tar.gz

Release files / py_auto_migrate-0.8.3.tar.gz

Download URL py_auto_migrate-0.8.3.tar.gz
Size 45.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8363ba08c7ae9b2189b24f9a97533a46b811b657d2e126a44cb68a1aa624b1ca
BLAKE2b-256 checksum
How to use checksums
71b0dde26913b7eab5d1e46402a1bb061a963dd3a76f4588ba4bdb996736d95c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Security for py-auto-migrate 0.8.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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