# Now available: convert MongoDB to PostgreSQL on Layerbase

> Layerbase can now turn a MongoDB or DocumentDB database into PostgreSQL tables, with a mapping you review first and checks before you switch.

Published: 2026-11-08
Canonical: https://layerbase.com/blog/mongodb-to-postgresql-conversion-now-available

You can now convert a MongoDB database into PostgreSQL on Layerbase. The source can be an external MongoDB database, Atlas included, or a managed DocumentDB database you already run with us.

The thing to know is that nothing gets copied until you have seen the plan. Layerbase reads the shape of your collections (field names, types and counts, never the document values) and suggests tables and columns. You edit that mapping, decide which references should become foreign keys, and approve it. Then it copies into a new PostgreSQL database and checks the result: row counts, a checksum of the preserved `_id` values, field coverage, and a sampled round trip back to documents.

Your source database is never changed. Fields you did not map can be kept in a JSONB column instead of being dropped, and each root row keeps its original `_id`.

## What it does not do

It does not rewrite your application. Your MongoDB queries need to become SQL, and indexes, validators, TTL rules and change streams do not carry over. There is also no live replication, so plan a short write freeze for the final copy and re-verify before you switch the connection string.

## Who can use it

Conversion is available on paid Layerbase plans once a payment has gone through. Free plans, complimentary plans and active Pro trials cannot start one yet. PostgreSQL is the only target for now; FerretDB as a source and MySQL or MariaDB as targets come later.

## Get started

Open the [MongoDB to PostgreSQL conversion page](/convert/mongodb-to-postgresql), or press **Convert** on a managed DocumentDB database in your dashboard. For the full walkthrough of mapping review, verification and cutover, read [Convert MongoDB to PostgreSQL with a mapping you can review](/blog/mongodb-to-postgresql-reviewed-conversion) and the [conversion docs](/docs/converting-engines#mongo-postgresql).
