PG-Migrate is a high-performance, cross-platform PostgreSQL table migration tool built with Rust, Tauri, and React. It is designed to be the fastest way to clone tables, schemas, and data between PostgreSQL databases with zero dependencies required on your system.
- Turbo Batching: Optimized multi-row
INSERTlogic that is up to 50x faster than standard migration tools. - Keyset Pagination: Uses Seek-based pagination (
WHERE id > last_val) instead of slowOFFSET, ensuring constant speed even for tables with millions of rows. - JSON/JSONB Support: High-fidelity transfer of complex metadata and document data.
- Schema Remapping: Easily move tables between different schemas (e.g., from
publictoarchive) during the migration process. - Sequence Synchronization: Automatically resets
SERIALandBIGSERIALsequences on the target database to prevent unique constraint violations. - Safety First: Non-destructive, high-fidelity cloning. Supports
ON CONFLICT DO NOTHINGand optional table truncation. - Bidirectional direction: Swap source and target with a single click.
- Smart Dependency Sorting: Automatically sorts selected tables based on Foreign Key relationships to prevent constraint errors.
- Schema Analysis: Compare source and target schemas before migration to detect missing columns or type mismatches.
- Cross-Platform: Native executables for Windows, Linux, and macOS.
- Backend: Rust with
sqlx(Asynchronous PostgreSQL driver). - Frontend: React + TypeScript + Vite.
- Bridge: Tauri (Smallest, fastest, and most secure desktop app framework).
You can download the pre-compiled executables for your operating system from the Releases page.
- Windows:
.exeinstaller or portable binary. - Linux:
.AppImageor.debpackage. - macOS:
.dmg(Universal, Intel/Apple Silicon).
If you prefer to build it yourself, ensure you have Node.js and Rust installed on your system.
# Clone the repository
git clone https://github.com/YOUR_USERNAME/pg-migrate.git
cd pg-migrate
# Install frontend dependencies
npm install
# Run in development mode
npm run tauri dev
# Build for production
npm run tauri buildOn Linux, you may need to install the following dependencies for the webview to work:
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-devMIT License - feel free to use and contribute!