Docs / Migration Guide

Migration Guide

This guide covers all paths to Maree-DB - from a simple connection-string change to a full Oracle migration.

Part 1 - Zero-Migration Switch

For MySQL, PostgreSQL, and Redis: just change your connection string. Your application doesn't know the difference. (SQL Server TDS connectivity is in final development - migrate your data today with the export/import path below.)

MySQL → Maree-DB

# Before mysql -h mysql-server -P 3306 -u myapp -p mydb # After mysql -h mareedb-server -P 3306 -u myapp -p mydb # Your app doesn't know the difference.

PostgreSQL → Maree-DB

# Before: postgresql://user:pass@pg-server:5432/mydb # After: postgresql://user:pass@mareedb-server:5432/mydb # No other changes required.

SQL Server → Maree-DB

// SQL Server TDS connectivity is in final development. // Today: export from SQL Server (bcp/CSV), import via the REST bulk // loader or the maree CLI, and connect over the PostgreSQL or MySQL // wire protocol. The connection-string switch lands with TDS.

Redis → Maree-DB

# Before: redis://redis-server:6379 # After: redis://mareedb-server:6379 # All RESP3 commands work as-is.

Part 2 - Oracle Migration

Prerequisites

  • Maree-DB installed and running
  • Oracle credentials with SELECT on the tables you want to export

Step 1: Export From Oracle (It Stays Online)

Use Oracle's own tools - Data Pump (expdp) or a CSV/SQL export. Your Oracle database only ever gets read.

# Export schema + data with Oracle Data Pump (or spool to CSV) expdp user/pass@ORCL schemas=MYAPP directory=DP_DIR dumpfile=myapp.dmp

Step 2: Convert the Column Types

Translate any Oracle type to its Maree-DB equivalent with the built-in, tested converter:

maree-db migrate map-type --source oracle --type "NUMBER(10,2)" # -> DECIMAL(10,2) maree-db migrate map-type --source oracle --type "VARCHAR2(255)"

Step 3: Import Over the Wire

Load the converted schema + data into Maree-DB with the standard psql or mysql client, or the REST bulk loader.

Stored Procedures (PL/SQL)

Column types convert automatically. PL/SQL packages and stored procedures are ported by hand - the free compatibility assessment from SupportCALL tells you which ones need attention. Automated PL/SQL translation is not a shipped feature.

Rollback

Your Oracle database is untouched throughout - the workflow only reads from it, never writes. To revert, just point your app back at Oracle.

Part 3 - MongoDB Migration

MongoDB collections load into Maree-DB's document model. Export each collection with MongoDB's own tool, then load the JSON over the REST endpoint.

# Export a collection to JSON (source stays online) mongoexport --uri mongodb://user:pass@mongo-host/mydb \ --collection orders --out orders.json # Load the documents into a Maree-DB document table over REST, # then verify the document count with SQL: SELECT COUNT(*) ...

BSON documents become JSONB columns; nested objects and arrays are preserved as JSONB.

Part 4 - Multi-Source Consolidation

Consolidating several databases into one Maree-DB? Migrate each with its own native export, then load them into the same instance - SQL sources over the wire, documents/KV over REST.

# Export each source with its native tool (each stays online) mysqldump --single-transaction -h prod-db -u app -p myapp > mysql.sql redis-cli -h cache-server --scan > redis.keys mongoexport --uri mongodb://doc-server/content --collection c --out content.json # Load into ONE Maree-DB instance and verify each with SELECT COUNT(*) mysql -h mareedb-server -P 3306 -u root -p myapp < mysql.sql

Part 5 - Roadmap: Live Sync (Zero-Downtime Cut-Over)

On the roadmap - not yet wired. A future release will add fully-automated live connectors that stream a source's binlog/WAL in real time so you cut over at zero lag. Today, use the export -> convert -> import workflow above (your source stays online during export). The command below is the target design.

# (roadmap) Start live sync maree-db migrate --live \ --source mysql://prod-db/myapp # (roadmap) Monitor replication lag maree-db migrate --status # (roadmap) Execute cutover when lag = 0ms maree-db migrate --cutover

Part 6 - cPanel Migration

For cPanel hosting environments, the Maree-DB cPanel plugin takes over the MySQL socket transparently. All sites continue working.

# Install the cPanel plugin (WHM) sudo /usr/local/cpanel/3rdparty/bin/installplugin maree-db-cpanel-plugin.tar.gz # The plugin: # 1. Installs Maree-DB alongside MySQL # 2. Migrates all databases automatically # 3. Redirects the MySQL socket to Maree-DB # 4. Every WordPress site works without any changes