Migrating an application from Oracle to PostgreSQL involves more than moving tables and database records. The application itself often contains Oracle-specific SQL statements, database drivers, connection settings, stored procedure calls, and framework configurations. These dependencies must be updated before the application can work correctly with PostgreSQL.
For a large application, finding and changing every Oracle-specific dependency manually can take considerable time. Developers must understand how the application communicates with Oracle, identify incompatible database operations, and make sure the replacement code behaves correctly with PostgreSQL.
Microsoft provides an AI-assisted application conversion workflow through the Postgres Skills plugin. It works with GitHub Copilot in Visual Studio Code and GitHub Copilot CLI. The workflow includes a skill named migrate-oracle-application that can inspect an existing application, identify Oracle dependencies, recommend changes, and convert application code for Azure Database for PostgreSQL.
The important difference is that this workflow works directly with the existing application repository. Developers do not need to move their source code into a separate migration project.
This article explains how to prepare an Oracle application, install the required migration skills, assess database dependencies, convert application code, and validate the results before deployment.
Understanding Azure's Oracle Application Migration Skills
The Postgres Skills plugin provides an AI-assisted workflow for PostgreSQL development and migration. It includes skills for PostgreSQL best practices, graph-related operations, and Oracle application conversion.
The migrate-oracle-application skill focuses on identifying and updating application code that depends on Oracle.
It supports two primary operations:
- Assessment: Examines the application repository, identifies Oracle-specific database interactions, and reports the changes required for PostgreSQL compatibility.
- Conversion: Uses assessment findings to update Oracle-specific application code and validates the changes through available build and test tools.
The workflow can examine several areas of an application, including:
- Oracle SQL statements and database queries.
- Oracle database drivers and connection configuration.
- ORM mappings and database access layers.
- Stored procedure and function calls.
- Application configuration and deployment files.
- Build dependencies and existing tests.
The skill can also use PostgreSQL destination metadata and converted schema artifacts to understand how the application should interact with the new database.
This is important because changing SQL syntax alone does not guarantee application compatibility. The application must use the correct destination tables, columns, data types, and database routines.
The application conversion capability is currently in preview. AI-assisted conversion can reduce manual effort, but developers must still review the generated changes and verify application behavior.
Understanding the Migration Architecture
The application conversion workflow combines several tools rather than depending on a single migration utility.
| Component | Responsibility |
|---|---|
| Existing application repository | Contains application source code, configuration, and tests |
| Postgres Skills plugin | Provides migration instructions and supporting tools |
| GitHub Copilot | Analyzes application code and assists with conversion |
| PostgreSQL extension | Provides database connections and destination metadata |
| Azure Database for PostgreSQL | Provides the target database environment |
| Build and test tools | Validate converted application code |
The workflow operates inside the development environment. It is not part of the application's production request-processing path.
The skill reads the existing application repository and uses available database information to understand the migration requirements. It then proposes or performs source-code changes after the required authorization.
There are three separate parts of a complete Oracle migration:
- Schema conversion changes Oracle database objects into PostgreSQL-compatible objects.
- Data migration transfers existing records from Oracle to PostgreSQL.
- Application conversion updates the application so it communicates correctly with PostgreSQL.
These activities are related, but they are not interchangeable. The application conversion skill does not automatically migrate production data.
Preparing the Development Environment
Before starting, prepare the application repository and destination database.
The recommended workflow uses Visual Studio Code with GitHub Copilot and the Microsoft PostgreSQL extension.
The main requirements include:
- Visual Studio Code with GitHub Copilot agent and plugin support.
- An active GitHub Copilot subscription with access to the required agent capabilities.
- Microsoft PostgreSQL extension.
- Postgres Skills plugin with the migrate-oracle-application skill.
- Node.js 22 or later for the supporting tooling.
- Docker Desktop or Docker Engine for PostgreSQL integration testing with synthetic data.
- The existing application's compiler, SDK, build tools, and test framework.
- A saved connection to a nonproduction Azure Database for PostgreSQL environment.
The application repository should already have at least one Git commit and an attached branch. Commit existing work and make sure the working tree is clean before allowing an AI agent to modify application files.
Also review your organization's policies for sharing source code and database metadata with AI services. Use secure saved database connections instead of pasting passwords or connection strings into chat.
Installing the Postgres Skills Plugin
Open Visual Studio Code and install the Microsoft PostgreSQL extension.
Next, configure the Postgres Skills marketplace and install the postgres-skills plugin through the Copilot customization and plugin interface.
After installation, start a new Copilot agent session and verify that the migrate-oracle-application skill is available.
The PostgreSQL extension and the Postgres Skills plugin serve different purposes. The extension provides database connectivity and database tools, while the plugin provides the migration skill and its supporting instructions.
Having the plugin installed does not automatically start a migration. The developer must explicitly invoke the skill.
Assessing an Existing Oracle Application
Assessment should be the first operation because it identifies migration requirements before application source code is changed.
Open the existing application repository in Visual Studio Code and start a Copilot agent session.
In Copilot Chat, invoke the migration skill using the following command:
/migrate-oracle-application mode=assess codebase=. postgres-connection=my-profile database=my_database schema=appReplace the example values with the actual saved PostgreSQL connection name, destination database, and schema.
The codebase value of a period indicates that the current workspace is the application repository.
The assessment examines the application and identifies Oracle-specific dependencies. It also checks relevant PostgreSQL destination objects when database connectivity is available.
The assessment is database-read-only by default and does not modify application source files.
Understanding the Assessment Report
After the assessment finishes, review the generated report:
.github/migrate-oracle-app/assessment/assessment-report.mdThe report helps developers understand the existing application's migration requirements.
It can include findings about:
- Oracle-specific SQL and database calls.
- Driver and connection configuration.
- ORM mappings and stored procedure dependencies.
- Missing or incompatible PostgreSQL objects.
- Existing build and test readiness.
- Recommended conversion changes.
- Assumptions and issues that require manual attention.
For example, an application might use Oracle-specific connection configuration and SQL statements throughout its repository. The assessment helps locate these dependencies and determine which files need attention.
Do not treat the assessment as proof that the application is PostgreSQL-compatible. It identifies the work required and provides evidence for planning the conversion.
Converting Oracle Application Code
After reviewing the assessment, developers can start the conversion process.
Use the same repository and destination context:
/migrate-oracle-application mode=convert codebase=. postgres-connection=my-profile database=my_database schema=appThe skill uses the matching assessment and presents the expected conversion impact.
It then requests authorization before modifying application source files.
Once approved, the workflow updates the relevant application code and uses the available build and test tools to validate the changes.
For example, consider an application that uses an Oracle database driver and Oracle-specific SQL.
The original database access code might look like this:
Connection connection =
DriverManager.getConnection(
"jdbc:oracle:thin:@localhost:1521:ORCL",
username,
password
);
PreparedStatement statement =
connection.prepareStatement(
"SELECT * FROM EMPLOYEES WHERE EMPLOYEE_ID = ?"
);
statement.setInt(1, employeeId);
ResultSet result = statement.executeQuery();A PostgreSQL implementation uses the PostgreSQL JDBC driver and a PostgreSQL connection configuration:
Connection connection =
DriverManager.getConnection(
"jdbc:postgresql://localhost:5432/companydb",
username,
password
);
PreparedStatement statement =
connection.prepareStatement(
"SELECT * FROM employees WHERE employee_id = ?"
);
statement.setInt(1, employeeId);
ResultSet result = statement.executeQuery();This is a simple example of changing database connectivity. Real applications may require additional changes to SQL syntax, transaction handling, data types, generated identifiers, and stored routine calls.
The migration skill can help identify and convert these patterns, but developers must confirm that the destination schema and application behavior match the original requirements.
Generating Additional Tests During Conversion
Existing tests are important because they help identify behavior changes after conversion.
The default conversion workflow uses existing tests. If additional test preparation and generation are needed, developers can explicitly enable the tests option:
/migrate-oracle-application mode=convert codebase=. postgres-connection=my-profile database=my_database schema=app options=testsThis option enables additional actions such as:
- Establishing a test baseline.
- Creating unit tests.
- Creating integration tests.
- Fixing broken tests.
Docker should be running when the workflow needs disposable PostgreSQL environments for integration testing.
It is important to understand that test generation is not the same as production validation. Generated tests may cover common application paths, but developers must add tests for important business rules, security requirements, transaction behavior, and edge cases.
Also, the tests option does not automatically authorize persistent database object creation or mutation testing against the destination database.
Reviewing Conversion Results
After conversion, do not immediately deploy the modified application.
First, inspect the generated conversion report:
.github/migrate-oracle-app/conversions/conversion-report.mdReview the file-level changes:
.github/migrate-oracle-app/conversions/file-diffs.mdThese reports help developers understand what changed, which validations were executed, and what work remains.
Pay particular attention to the following areas:
- Database driver and connection configuration.
- SQL statements and parameter binding.
- Oracle-to-PostgreSQL data type differences.
- Transaction boundaries and rollback behavior.
- Sequence and identity generation.
- Stored procedure and function calls.
- Application build and deployment configuration.
- Test results and unresolved migration findings.
Use Git to review every modified file:
git status --short
git diffIf a generated change modifies business logic, security behavior, or transaction handling, review it carefully with the application and database teams.
The skill leaves the changes in the working tree for normal code review. Developers remain responsible for approving, committing, and deploying those changes.
Handling Complex Oracle Dependencies
Not every Oracle feature has a direct PostgreSQL replacement.
Applications with simple SQL queries and standard database operations may require relatively limited changes. Applications using advanced Oracle features can require additional design work.
For example, the following Oracle dependencies need special attention:
- PL/SQL packages containing business logic.
- Oracle Advanced Queuing.
- Oracle Spatial functionality.
- Oracle Text search.
- Oracle system packages such as DBMS and UTL packages.
- Oracle-specific failover and access-control behavior.
In these situations, replacing a function name or SQL statement may not preserve the original behavior.
Developers should identify the expected business behavior and decide whether PostgreSQL provides an equivalent feature or whether the application needs a different implementation.
If the original routine definitions are unavailable, the migration process may need to work from application code, mappings, and tests. Any reconstructed behavior should be reviewed against authoritative Oracle definitions before it is trusted.
Best Practices for a Successful Migration
A successful migration depends on more than running the conversion skill.
Keep the following practices in place throughout the project:
- Complete and validate the PostgreSQL schema conversion before relying on database-backed application testing.
- Use a clean Git baseline so every generated source change can be reviewed.
- Provide converted schema definitions, Oracle DDL artifacts, and coding notes whenever available.
- Use a nonproduction PostgreSQL database for assessment and validation.
- Run one migration workflow against a repository at a time to avoid conflicting changes.
- Review SQL semantics, transaction behavior, and database routine implementations manually.
- Run existing unit tests, integration tests, and business-level validation before deployment.
- Keep production data migration separate from application code conversion.
The workflow also provides separate opt-in actions for creating persistent destination objects and testing database writes. These operations require explicit authorization and appropriate database permissions. They should not be enabled casually, especially against production databases.
Summary
Moving Oracle application code to PostgreSQL can be a complex task because database dependencies are often spread across application source files, configuration, ORM mappings, and stored routine calls.
Microsoft's Postgres Skills plugin provides the migrate-oracle-application skill to help developers assess these dependencies and convert application code for Azure Database for PostgreSQL.
The workflow supports GitHub Copilot in Visual Studio Code and GitHub Copilot CLI. Developers can first generate an assessment report, review the migration requirements, authorize source changes, and then validate the converted application using build and test tools.
The most important point is that AI-assisted conversion should be treated as a development and migration aid, not an automatic guarantee of compatibility. Review generated changes, validate database behavior, and test critical business workflows before moving production traffic to PostgreSQL.


Join the conversation! Your thoughts help the community grow.