SQL Migration & Task Manager
Migrate data between MongoDB and SQL databases with intelligent type mapping, schema generation, and bidirectional support. Use SQL tables, views, or queries as sources for importing into MongoDB, or export MongoDB collections directly to SQL databases.
Set up a SQL migration in minutes:
Import data from SQL databases into MongoDB using these source options.
| Source Type | Description | Use Case |
|---|---|---|
SQL Table |
Import all rows from a SQL table | Full table migration to MongoDB collection |
SQL View |
Import from a SQL view (pre-joined/filtered data) | Import denormalized data from multiple tables |
SQL Query |
Import using custom SELECT statement | Complex joins, filters, or transformations at source |
Export MongoDB data to SQL databases using these target options.
| Target Type | Description | Use Case |
|---|---|---|
SQL Table |
Export directly to a SQL database table | Live migration with Insert/Upsert/DropInsert modes |
SQL Script |
Generate SQL INSERT/UPDATE statements as a file | Review before execution, version control, manual apply |
VisuaLeaf supports migration to and from major relational databases.
| Database | Versions | Features |
|---|---|---|
| MySQL | 5.7+, 8.0+ | JSON columns, SSL/TLS, connection pooling |
| PostgreSQL | 10+, 12+, 14+, 16+ | JSONB columns, array types, SSL/TLS |
| SQL Server | 2016+, 2019+, 2022+ | Windows/Linux, Azure SQL, SSL/TLS |
| Oracle | 12c+, 19c+, 21c+ | JSON columns, connection pooling |
VisuaLeaf automatically maps MongoDB types to appropriate SQL types, with manual override options.
| MongoDB Type | MySQL | PostgreSQL | SQL Server |
|---|---|---|---|
| String | VARCHAR / TEXT | VARCHAR / TEXT | NVARCHAR / NTEXT |
| Number (Int) | INT / BIGINT | INTEGER / BIGINT | INT / BIGINT |
| Number (Double) | DOUBLE | DOUBLE PRECISION | FLOAT |
| Boolean | TINYINT(1) | BOOLEAN | BIT |
| Date | DATETIME | TIMESTAMP | DATETIME2 |
| ObjectId | CHAR(24) | CHAR(24) | CHAR(24) |
| Object / Array | JSON | JSONB | NVARCHAR(MAX) |
Configure SQL column properties for each mapped field.
Control how data is written to the target SQL table.
| Mode | Behavior | Use Case |
|---|---|---|
| Insert | Insert new rows only, fail on duplicates | First-time migration, append-only data |
| Upsert | Insert new rows, update existing (by primary key) | Incremental sync, keep data up-to-date |
| Drop & Insert | Drop table, recreate schema, insert all rows | Full refresh, schema changes |
Protect sensitive data during migration by applying masking transformations. Data masking allows you to export data for development, testing, or analytics while obscuring personally identifiable information (PII) and other sensitive fields.
| Mask Type | Description | Example |
|---|---|---|
| Redact | Replace with fixed placeholder | john@email.com → [REDACTED] |
| Partial Mask | Show first/last characters only | john@email.com → j***@***.com |
| Hash | One-way hash (SHA-256) | john@email.com → a8f5f167... |
| Randomize | Replace with random value of same type | 555-1234 → 382-9471 |
| Fake | Generate realistic fake data | John Smith → Jane Doe |
| Null | Replace with null/empty | secret123 → null |
Apply masking in the field transformation section of your export job:
// Redact completely
return '[REDACTED]';
// Partial mask email
return value.replace(/(.{1}).*@(.*)\.(.{2,})/, '$1***@***.$3');
// Hash value (consistent across runs)
return crypto.sha256(value);
// Randomize phone number
return '555-' + Math.floor(1000 + Math.random() * 9000);
// Null out field
return null;
| Field Type | Recommended Mask | Result |
|---|---|---|
| Partial mask | j***@***.com |
|
| Phone | Partial mask (last 4) | ***-***-1234 |
| SSN / ID | Hash or redact | ***-**-6789 or hash |
| Credit Card | Partial mask (last 4) | ****-****-****-1234 |
| Name | Fake data | Random realistic name |
| Address | Fake or redact | Random address or [REDACTED] |
| Password | Null or exclude | Don't export passwords |
Download and start managing your MongoDB databases with ease.
Download Free Trial