No single tool migrates a production SQL Server database to PostgreSQL. Each one covers a part: schema conversion, bulk load, ongoing change capture, or validation. This guide sorts the common options by the job they do.
Schema and code conversion
- AWS Schema Conversion Tool. Converts schema and attempts procedural code, with a report of what it could not convert. That report is a useful first estimate of manual effort, whatever the target hosting is.
- sqlserver2pgsql. An open source script that converts a SQL Server schema dump into PostgreSQL DDL. Schema only. Procedural code is left to the team.
- Commercial converters. Products such as Ispirer SQLWays convert a larger share of T-SQL automatically. The output still needs review and tests.
Treat converted procedural code as a draft. The differences in error handling and transactions are behavioral, and a converter translates syntax.
Bulk data load
- pgloader. Open source. Reads from SQL Server and loads PostgreSQL in one command, creating tables and casting types by rule. Good for rehearsals and for databases that can take a downtime window. It does not keep the two sides in sync afterward.
- Export and
COPY. Flat files out of SQL Server,COPYinto PostgreSQL. Simple, fast, and fully under the team's control for large tables.
Ongoing change capture
A migration with a short cutover window needs changes to flow from SQL Server to PostgreSQL while both run.
- AWS Database Migration Service. Full load plus change capture. Widely used when the target is on AWS. Watch large objects, tables without primary keys, and schema changes during the run.
- Debezium. Open source change capture from SQL Server's CDC tables into Kafka. Flexible, and it brings a streaming platform that someone has to operate.
- Commercial replication products. Qlik Replicate, Striim and similar tools cover the same job with vendor support.
Whichever tool is chosen, choose it from the failure modes it must survive: tables without keys, high write volume, schema changes mid-migration, and a rebuild that must not load the primary.
Compatibility layers
- Babelfish. Lets PostgreSQL accept T-SQL and the SQL Server wire protocol, available on Aurora PostgreSQL and as an open source project. It can shorten the first move for applications that cannot be changed quickly. Coverage of T-SQL is partial, and the team takes on a second dialect inside PostgreSQL. It defers the rewrite; it does not remove the need to test.
Validation
- tds_fdw. A foreign data wrapper that lets PostgreSQL query SQL Server directly. Useful for reconciliation queries that compare both sides in one statement.
- Your own reconciliation queries. Row counts, aggregates and sampled row comparisons, scheduled and stored. See the data type guide for what to compare.
What no tool covers
- Who owns production while both platforms run.
- Which threshold stops a cutover, and who makes that call.
- A rollback rehearsed after the target has accepted writes.
- Monitoring, backup and recovery procedures the operations team has practiced on PostgreSQL.
These are the items on the migration checklist that decide whether the migration holds. Tool choice is a week of the plan. The rest is operations.
Where this leads
Datrick runs SQL Server to PostgreSQL migrations and operates the database afterward, with named engineers and a written scope. The service page describes the delivery model: SQL Server to PostgreSQL migration. For a first read of risk and effort, see the migration risk assessment.
Related: SQL Server to PostgreSQL migration · migration risk assessment · Production Migration Notes · PostgreSQL DBA services
