From:       To:      
Home > Documentation > SQL Server to PostgreSQL

SQL Server to PostgreSQL Migration with Babelfish

This article explores yet another option of SQL Server to PostgreSQL database migration using freeware tools. Babelfish is an open-source tool enabling database connections to PostgreSQL database from SQL Server clients. This means that applications originally developed for SQL Server can seamlessly work with PostgreSQL, requiring minimal code modifications compared to a traditional migration process and without the need to change database drivers.

By integrating Babelfish, PostgreSQL database cluster gains an additional endpoint that understands the SQL Server wire-level protocol and commonly used SQL Server statements. This approach allows client applications utilizing the Tabular Data Stream (TDS) wire protocol to establish native connections to the TDS listener port on PostgreSQL. Babelfish supports TDS versions 7.1 and higher, ensuring compatibility with a wide range of SQL Server client applications.

Using these capabilities, Babelfish can be involved into SQL Server to PostgreSQL database migration according to the following steps:

At this point all client applications that work with SQL Server database should be updated to connect to the PostgreSQL/Babelfish instance instead of SQL Server. Modify the connection settings to point to the new data source and then make necessary testing. It is extremely important to run comprehensive tests covering various functionalities, queries, and scenarios within your applications. Pay close attention to any unexpected behavior, errors, or performance issues that may arise during SQL Server to PostgreSQL migration.

You have learned how to use Babelfish with SQL Server applications. Since the new data is actually stored in a PostgreSQL database, this is about SQL Server to PostgreSQL migration. Babelfish acts here as a proxy between SQL Server and PostgreSQL assisting with smooth and safe near-to-zero downtime migration between the two DBMS. The resulting database can be accessed with any PostgreSQL client connected to the appropriate PostgreSQL port (by default 5432) and not to the TDS port (by default 1433).

Have questions? Contact us