At a glance
| Source databases | Oracle, MySQL and MariaDB, SQL Server (since 24.0) |
| Target databases | PostgreSQL |
| Schema conversion | Yes, including PL/SQL to PL/pgSQL; review of converted code still needed |
| Data migration | Offline (requires downtime): COPY or INSERT files, direct load, or oracle_fdw |
| Automation and CLI | Command line driven by ora2pg.conf; options can be overridden per run (-O in 25.0) |
| Deployment | Local install of Perl and DBD drivers (Strawberry Perl on Windows) |
| Licensing | Free and open source, GPL v3 |
Ora2Pg is the long-standing open source starting point for Oracle to PostgreSQL migrations: it reports what is in the source, estimates the work, converts schema and much of the PL/SQL, and exports or loads data. It is a command-line tool configured through a large configuration file, and data movement is offline, so plan downtime or add a replication tool.
Overview
Ora2Pg connects to an Oracle database, scans it, and generates SQL scripts that recreate its structure and data in PostgreSQL. It handles tables, views, sequences, indexes, grants, partitions, synonyms, materialized views and procedural code (functions, procedures, packages, triggers), converting PL/SQL to PL/pgSQL where it can. Since version 24.0 (July 2023) it also migrates SQL Server databases, and it has long supported MySQL and MariaDB sources.
It is written in Perl and needs Perl 5.10 or later plus the matching DBI drivers: DBD::Oracle for Oracle, DBD::MySQL for MySQL and DBD::ODBC for SQL Server; on Windows the README recommends Strawberry Perl. Output goes to files that you load with psql, or straight into PostgreSQL through DBD::Pg for COPY and INSERT exports. The current release is 25.0 (April 2025).
Key features
- Migration assessment report (SHOW_REPORT) with a cost estimate in person-days and a migration difficulty level (ESTIMATE_COST)
- Schema export by object type: TABLE, VIEW, SEQUENCE, GRANT, PARTITION, MVIEW, SYNONYM and more
- PL/SQL to PL/pgSQL conversion for functions, procedures, packages and triggers
- Data export as COPY or INSERT files, or direct load into PostgreSQL through DBD::Pg
- Parallel data export, including each partition of a partitioned table in version 25.0
- FDW export type that creates oracle_fdw foreign tables, with oracle_fdw data movement options
- Data validation between source and target
Pros and cons
Pros
- Free and open source, with a long history in Oracle to PostgreSQL projects
- Assessment report and effort estimate before you commit to a migration
- Converts procedural code, not only tables and data
- Fine-grained control through export types and configuration directives
Cons
- Data migration is offline; online migration is not part of Ora2Pg
- Needs Perl, DBD drivers and Oracle client libraries installed, which takes setup work
- Target is PostgreSQL only
- Configuration file has many directives to learn
Pricing
Ora2Pg is free and open source under the GNU GPL v3. There is no paid edition of Ora2Pg itself; the project site also promotes HexaRocket, a separate commercial product for online migrations.
Pricing checked on the vendor's official page on 7 November 2026. Prices change; confirm before buying.
Who it is best for
DBAs and consultants moving Oracle, MySQL or SQL Server databases to PostgreSQL who want a free tool that assesses the work and converts schema and procedural code.
Who should look elsewhere
- Migrations that must stay online until a short cutover: pair Ora2Pg schema output with a replication service such as the AWS Database Migration Service.
- Targets other than PostgreSQL: see SQLines or SQL Server Migration Assistant.
Verdict
Ora2Pg remains the free default for assessing and converting Oracle schemas and PL/SQL to PostgreSQL, and its newer SQL Server and MySQL support widens its use. Expect setup effort with Perl and drivers, manual review of converted code, and a downtime window for the data copy.
Frequently asked questions
Is Ora2Pg free?
Yes. Ora2Pg is free and open source under the GPL v3. The project site also lists HexaRocket, a separate commercial product for online migrations.
Can Ora2Pg migrate SQL Server or MySQL to PostgreSQL?
Yes. It supports MySQL and MariaDB sources, and version 24.0 (July 2023) added SQL Server to PostgreSQL migration, which needs the DBD::ODBC driver.
Does Ora2Pg do online migration?
No. The project describes its data migration as offline, requiring downtime. For minimal downtime you need a replication tool alongside it.
Sources
Checked November 2026.
How we research reviews and what star ratings mean: our editorial method.