1
Prepare Neon
Create a dedicated ClickPipes user with read and replication permissions:Run these steps on your production Neon branch, repeating the grants for every schema you want to migrate.
Each replicated table must have a primary key or use
REPLICA IDENTITY FULL.In the Neon console, go to Settings → Logical Replication and enable logical replication.
If you use IP restrictions, allow the ClickPipes static IP addresses. See the Neon source setup guide for detailed instructions.2
Migrate and cut over with ClickPipes
Follow the ClickPipes migration guide to configure and complete the migration.
ClickPipes automates the end-to-end process:
- Migrates the source schema to an empty target database.
- Performs an optimized initial load using parallel snapshotting.
- Uses CDC to keep the target synchronized with Neon.
- Provides progress, replication-lag, and error monitoring.
- Guides you through validation and cutover.
- Set Neon in read-only mode to stop writes.
- Validate row counts between source and target.
- Pause the pipe.
- Reset sequences on the target.
- Cut over traffic by updating the application connection string to point to ClickHouse Managed Postgres.
- Clean up by dropping the replication slot and deleting the ClickPipe.
Migration considerations
Branches
Neon provides instant copy-on-write branching. ClickHouse Managed Postgres uses local NVMe storage to deliver fast, predictable, and reliable Postgres performance. The trade-off is that branches are not instantaneous; instead, they are created as independent deployments using Point-in-Time Recovery (PITR). They typically become available within a few minutes. For everyday development, we recommend maintaining a smaller ClickHouse Managed Postgres development database with representative, sanitized production data - for example, a few gigabytes and creating PITR branches from it as needed. Branch creation and cleanup can be automated through clickhousectl, our official CLI or OpenAPI or Terraform Some customers use this approach to manage hundreds of development environments. We are actively improving the forking and sandboxing experience. See the branching documentation.Neon Serverless Driver
If your application does not use the Neon Serverless Driver, you can skip this section. Applications running on platforms such as Vercel may use the Neon Serverless Driver, which is WebSocket-based and specific to Neon. It cannot simply be pointed to ClickHouse Managed Postgres. Before migrating:- Check for dependencies such as @neondatabase/serverless. If present, replace them with a standard Postgres driver such as node-postgres (pg).
- For serverless workloads that create many short-lived connections, use the bundled PgBouncer instance.
- Prepared statements are supported. However, because PgBouncer uses transaction pooling, validate applications that rely on session-level behavior, which is uncommon in most applications:
- Use
SET LOCALinstead of session-levelSETorRESET. - Use transaction-scoped temporary tables with
ON COMMIT DROP. NOTIFYis supported;LISTENis not.- Use transaction-level, not session-level, advisory locks.
- Transaction-scoped cursors are supported;
WITH HOLDis not.
- Use
- If your application depends on unsupported session-level behavior, connect directly to Postgres instead of through PgBouncer.
Connection limits
ClickHouse Managed Postgres supports 500 direct Postgres connections by default. If your Neon workload exceeds this number, you can:- Use application-side connection pooling.
- Use the bundled PgBouncer instance, which supports up to 5,000 client connections.
- Increase
max_connectionsif more direct connections are required.max_connectionscan be changed from Settings → Edit parameters. Some changes require a restart. See the configuration documentation.
Schema changes during migration
Keep the period between starting ClickPipes and cutover as short as possible — ideally no more than a few days — and avoid schema changes during this window. Some customers maintain parallel environments for several days while testing their applications against ClickHouse Managed Postgres. Once testing is complete, they start a fresh ClickPipe for the final migration, minimizing the time between the initial load and cutover. CDC replicates inserts, updates, deletes, andADD COLUMN, but most other DDL changes are not propagated. This includes indexes, triggers, enum changes, constraints, functions, and most column modifications.
Some changes, such as a missing enum value, cause replication to stop and appear in the ClickPipes logs. Apply the missing change to the target, and replication should resume. Other changes, such as a newly created index or trigger, may not interrupt CDC but must still be created manually before cutover.
Before switching traffic, compare the source and target schemas, apply any missing objects, and reset sequences. The migration FAQ covers common errors and remediation steps.