Move data, schema, and indexes from a MariaDB database into ParadeDB (PostgreSQL) safely and with minimal downtime.
ParadeDB builds on PostgreSQL’s reliability and advanced indexing, giving teams richer JSON, full-text, and analytical features lacking in MariaDB. Migrating unlocks better performance and a single engine for transactional and analytical workloads.
Use pgloader
to automate schema translation, type mapping, and data copy in a single command. It streams directly from MariaDB to ParadeDB without intermediate files, cutting downtime.
pgloader
work?pgloader
connects to MariaDB, reads table definitions, rewrites them for PostgreSQL, and bulk loads data into ParadeDB using the COPY
protocol. It can run incremental syncs for a zero-downtime cut-over.
Install ParadeDB ≥ 15, pgloader ≥ 3.6, and ensure network connectivity between hosts. Create an empty ParadeDB database and matching users with sufficient privileges.
Basic syntax
pgloader mysql://USER:PWD@HOST/DBNAME \
postgresql://USER:PWD@HOST/DBNAME \
[OPTIONS]
Common options include --with data only
, --with schema only
, --dry-run
, and --cast
for custom type mapping.
pgloader \
mysql://maria_user:secret@10.0.0.5/ecommerce \
postgresql://pg_user:secret@10.0.0.6/ecommerce \
--cast 'type datetime to timestamptz' \
--with "create tables, create indexes, reset sequences"
This moves Customers
, Orders
, Products
, and OrderItems
, translating DATETIME
to TIMESTAMPTZ
.
Run row counts in both systems and compare hashes:
-- ParadeDB
SELECT 'Customers' AS tbl, COUNT(*) FROM Customers
UNION ALL
SELECT 'Orders', COUNT(*) FROM Orders;
Spot-check critical queries for parity and run application test suites against ParadeDB.
Yes. Enable binlog
on MariaDB and use pgloader’s --follow
option to stream change events until switchover. Cut application traffic once parity is confirmed.
MariaDB procedures must be rewritten in PL/pgSQL. Export them with mysqldump --routines
, then translate manually or with tools like Ora2Pg
.
--verbose
and log output.Run VACUUM ANALYZE
and create ParadeDB-specific indexes such as gin
on JSON columns. Adjust connection pooling parameters to fit PostgreSQL.
With pgloader’s --follow
stream and a brief cut-over window, downtime can be limited to seconds.
Yes. Use a load file specifying only target tables or --exclude-table
patterns.
ParadeDB uses SERIAL
or GENERATED BY DEFAULT AS IDENTITY
. pgloader automatically creates sequences and resets them.