https://github.com/kasrakhaksar/py-auto-migrate
A Powerful Database Migration Tool To Transfer Data 🚀
https://github.com/kasrakhaksar/py-auto-migrate
ai cli clickhouse database dynamodb elasticsearch mariadb mongodb mysql oracle postgresql pypi-package python redis sqlserver
Last synced: 20 days ago
JSON representation
A Powerful Database Migration Tool To Transfer Data 🚀
- Host: GitHub
- URL: https://github.com/kasrakhaksar/py-auto-migrate
- Owner: kasrakhaksar
- Created: 2025-08-15T15:53:46.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2026-05-13T11:53:49.000Z (about 1 month ago)
- Last Synced: 2026-05-13T13:38:04.958Z (about 1 month ago)
- Topics: ai, cli, clickhouse, database, dynamodb, elasticsearch, mariadb, mongodb, mysql, oracle, postgresql, pypi-package, python, redis, sqlserver
- Language: Python
- Homepage:
- Size: 36 MB
- Stars: 4
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
🚀 Py-Auto-Migrate
The Universal Database Migration Tool
Seamlessly transfer data between any database.
---
## 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`.
```bash
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](https://github.com/kasrakhaksar/py-auto-migrate/releases). 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
```bash
py-auto-migrate migrate --source --target
```
| 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). |
### Real-World Examples
**1. Migrate an entire database from MongoDB to MySQL:**
```bash
py-auto-migrate migrate \
--source "mongodb://user:pass@localhost:27017/source_db" \
--target "mysql://user:pass@localhost:3306/target_db"
```
**2. Migrate a single PostgreSQL table to a new MongoDB collection:**
```bash
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.
**3. Query using AI (Target must be a relational database):**
```bash
export OPENAI_API_KEY="your-api-key"
```
> Before using AI, make sure the **OPENAI_API_KEY** has been exported.
```bash
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"
```
---
## Supported Databases
We support a wide and growing range of databases.
| Category | Databases |
| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Relational** | [](https://www.mysql.com/) [](https://www.postgresql.org/) [](https://www.oracle.com/database/) [](https://www.microsoft.com/en-us/sql-server) [](https://mariadb.org/) [](https://www.sqlite.org/) |
| **NoSQL** | [](https://www.mongodb.com/) [](https://redis.io/) [](https://aws.amazon.com/dynamodb/) [](https://www.elastic.co/elasticsearch/) |
| **Analysis** | [](https://clickhouse.com/) |
---
Have a feature request? [Open an issue](https://github.com/kasrakhaksar/py-auto-migrate/issues) and let us know!