Migration Guide
Moving to Maree-DB ranges from "change the connection string" (MySQL, PostgreSQL, SQL Server, Redis) to "run the migration wizard" (Oracle, MongoDB). This guide covers every scenario.
Zero-Migration Switch — MySQL, PostgreSQL, SQL Server, Redis
Maree-DB implements the native wire protocols of MySQL, PostgreSQL, SQL Server (MS-TDS), and Redis. For most applications, migration is simply transferring the data and updating the connection string. Your application never knows it switched databases.
Install Maree-DB
See the Installation Guide. Run on the same server or a new server — both approaches work.
Transfer data using your existing tools
Update your connection string
Change the host (and optionally the port) in your application's database configuration. No code changes required.
Done. Your application doesn't know the difference.
Maree-DB speaks the same protocol as your old database. Restart your application pointing at the new host. Monitor for 15 minutes. Decommission the old server when you're confident.
Troubleshooting: vendor-specific quirks
If you hit compatibility issues (stored procedure syntax, non-standard functions, driver-specific handshake quirks), run maree-db-cli compat-report --source mysql://old-host/mydb — it produces a compatibility report listing any SQL that may need adjustment before migration.
Oracle / MongoDB Escape — Migration Wizard
Oracle and MongoDB use proprietary APIs, schemas, and data models. Maree-DB's Migration Wizard handles the translation automatically: PL/SQL → stored procedures, CONNECT BY → recursive CTEs, BSON → JSONB, MQL → SQL+JSONPath.
Prerequisites
- Network access from Maree-DB host to the source database
- Read-only credentials on the source database
- Sufficient disk space for the migration snapshot (roughly equal to source database size)
Dry run — validate before committing
Execute the migration
Validate
Cutover
Update your application connection string to point at Maree-DB. For Oracle, use the MySQL or PostgreSQL wire protocol. For MongoDB, use the REST API or MySQL wire protocol with JSON columns.
If needed, rollback is available until you explicitly confirm the migration:
Oracle → Maree-DB Type Mapping
| Oracle | Maree-DB | Notes |
|---|---|---|
NUMBER(p,s) | DECIMAL(p,s) | Exact numeric preserved |
VARCHAR2(n) | VARCHAR(n) | Direct mapping |
CLOB | TEXT | No size limit |
BLOB | BLOB | Direct mapping |
DATE | DATETIME | Oracle DATE includes time component |
TIMESTAMP WITH TIME ZONE | TIMESTAMP WITH TIME ZONE | Direct mapping |
CONNECT BY PRIOR | Recursive CTE (WITH RECURSIVE) | Automatically translated |
ROWNUM | ROW_NUMBER() OVER() | Automatically translated |
SYSDATE | NOW() | Automatically translated |
NVL(a,b) | COALESCE(a,b) | Automatically translated |
DUAL | Omitted (not needed) | SELECT 1 works directly |
| PL/SQL procedures | Stored procedures | 36/38 translate automatically; complex DBMS_* calls flagged for review |
BULK COLLECT INTO | Batch SELECT | Translated to batch operations |
MongoDB → Maree-DB Type Mapping
| MongoDB | Maree-DB | Notes |
|---|---|---|
| Collection | Table with JSONB data column + GIN index | Full document stored as JSONB; indexed fields extracted as columns |
| BSON document | JSONB | Native JSONB with path operators |
ObjectId | VARCHAR(24) | Stored as hex string |
$lookup | LEFT JOIN | Translated to standard SQL JOIN |
$match | WHERE | MQL predicates → SQL WHERE with JSONPath |
$group | GROUP BY | Aggregation pipeline → SQL aggregates |
$sort | ORDER BY | Direct mapping |
$limit | LIMIT | Direct mapping |
| Text index | Full-text index | Translated to GIN tsvector index |
| Geospatial index | Spatial R-Tree index | GeoJSON points/polygons → GEOMETRY type |
Multi-Source Consolidation
Replace multiple separate databases with a single Maree-DB instance. Specify all sources in one command — the migration wizard migrates them in parallel and maps each to the appropriate Maree-DB data model.
Live Migration (CDC) — Zero Downtime
Change Data Capture (CDC) allows you to migrate while the source database continues serving live traffic. Maree-DB continuously replicates changes from the source until you cut over. Zero downtime. Zero data loss.
Start CDC replication
Monitor replication lag
Cutover
When you're ready, perform the cutover during a low-traffic window. The process takes seconds:
cPanel Migration — Automatic Socket Takeover
The Maree-DB cPanel plugin replaces MySQL on cPanel/WHM servers. The plugin intercepts the MySQL socket so existing hosted sites continue to work immediately — with zero configuration changes on any hosted site.
After installation, all existing WHM/cPanel database operations continue to work through the MySQL wire protocol. Maree-DB silently handles all requests. New sites are automatically provisioned in Maree-DB.