Skip to content

Migrate from Netlify DB to Layerbase

Move the Postgres behind your Netlify site to a managed Layerbase database. Copy the connection string out of the Netlify CLI and we copy the schema and data in one pass. Your site keeps deploying on Netlify: the only thing that changes is where the database lives.

Still comparing? Netlify DB alternatives

Old database never modified or deleted
Credentials never stored
Free tier, no credit card

Why teams leave Netlify DB

Your database stops being a deploy-platform line item

Netlify Database is only available on credit-based plans, and an active database burns credits for compute and bandwidth. A Layerbase Postgres is $0 on the Free tier, then $5/mo Solo or $15/mo Pro, and the number does not move when your traffic does or when you change how you deploy.

It is Neon underneath, with a Netlify bill on top

Netlify DB is Neon Postgres that Netlify operates and resells. You get a second party between you and your data, and the pricing model of whoever you deploy with. Layerbase hosts the database as the product, so the connection string is yours and it outlives whatever you deploy on next.

You keep the branching workflow

Netlify gives every deploy preview its own database branch. Layerbase Postgres branches copy-on-write in seconds too, from the dashboard, the API, or the CLI, so preview and experiment branches keep working after the move. They just stop being tied to one host.

A database with a dashboard

Daily backups, point-in-time recovery on Pro, a web SQL console, TLS connection strings, and a real Postgres you can point psql at. Every other engine we host, Redis and Valkey through search and analytics, sits in the same account when your app outgrows one database.

Four steps, one pass

  1. 1

    Create a free account or sign in

    Sign in with Google or GitHub. No credit card is needed to start, and the migration wizard opens with this platform already selected.

  2. 2

    Paste your connection string

    Netlify Database does not print the raw connection string in the dashboard, so get it from the Netlify CLI: run netlify database status --show-credentials in your project (or netlify database connect --json) and copy the full postgresql:// string. Netlify Databases are Neon-backed Postgres and are reachable from any client, so the string works as it is. Add --branch <name> to copy a deploy-preview branch instead of production.

  3. 3

    Pick what to migrate and name it

    Choose what to bring over, give the new Layerbase database a name, and start the migration. Progress streams live in the dashboard.

  4. 4

    We copy it in one pass

    The migration reads from Netlify DB once and never writes to it. Credentials are used for the copy and never stored. When it finishes, you land in your new database with a live TLS connection string.

Common Netlify DB migration questions

Where do I find my Netlify DB connection string?

From the Netlify CLI, not the dashboard: run netlify database status --show-credentials in your project and copy the full postgresql:// string, or netlify database connect --json if you prefer JSON. Add --branch <name> to target a deploy-preview branch instead of production. Netlify Databases are Neon-backed Postgres and reachable from any client, so the string works as it is.

Do I have to keep deploying on Netlify?

No, and you do not have to leave either. This migrates the database only. Your site keeps building and deploying on Netlify exactly as it does today: you point it at the Layerbase connection string and redeploy. The database is simply no longer tied to that account.

I use @netlify/database in my code. What changes?

getDatabase() resolves its own connection from the Netlify environment, so once the data is on Layerbase you either pass your connection string explicitly, getDatabase({ connectionString }), or swap to a standard Postgres driver like pg, postgres, or your ORM adapter. The SQL does not change. If you are still on the legacy @netlify/neon HTTP driver, it keeps working unchanged: Layerbase Postgres implements the same HTTP query protocol.

What about my deploy-preview database branches?

Those are Netlify plumbing, so they do not travel. Layerbase Postgres branches copy-on-write in seconds and you drive them from the dashboard, the API, or CI, so you can wire the same per-preview branch into your Netlify build. We migrate the branch whose connection string you paste, which is production unless you pass --branch.

Will my Netlify database be modified?

No. The migration is read-once: we connect with the string you paste, copy the schema and data, and disconnect. Nothing is written back and your site keeps serving traffic throughout. There is no ongoing sync afterwards, so plan a cutover rather than running both for a while.

What does it cost?

Postgres is on the Layerbase Free tier, so you can migrate and compare without a credit card. Paid plans start at $5 a month when you need more databases or resources. Layerbase Cloud hosts 18 engines on one account, so the Postgres you move is not the last database you can put here.

Ready to leave Netlify DB?

Sign in, and the migration wizard opens with Netlify DB already selected. Your source is read once and never modified, so there is nothing to undo if you change your mind.