Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The PostgreSQL extension for Visual Studio Code provides a guided workflow for Oracle schema and application conversion. Schema conversion supports Azure Database for PostgreSQL flexible server and Azure HorizonDB for both schema validation and deployment. This guide explains how the schema and application workflows fit together. Use the schema conversion tutorial for the complete configuration and conversion procedure. Plan row-data migration separately.
Important
Schema and application conversion are available in Visual Studio Code only.
How schema and application conversion fit together
For a combined schema and application conversion, use the two workflows in sequence. Schema conversion produces the PostgreSQL data definition language (DDL) for your database objects, and application conversion updates the code that calls them. Application conversion can also run independently.
Schema conversion
Schema conversion reads the Oracle data dictionary for the selected schemas and uses your Microsoft Foundry deployment to generate PostgreSQL DDL. The tool attempts compilation in the schema validation database and uses available static checks to identify issues. These checks don't establish equivalent runtime behavior or production readiness. A run produces:
- Object-level PostgreSQL
.sqlfiles inpostgres_ddl, organized by Oracle schema and object type. - An HTML conversion report with discovery, extraction, and conversion results, conversion rates, and object-level notes.
- Object mappings and notes that you can inspect in Conversion Object Explorer, including objects that need manual changes.
- Setup instructions and scripts that use the object files in
postgres_ddlfor a separate deployment operation. - Coding notes that describe the Oracle patterns found in the schema and how they map to PostgreSQL.
Application conversion
Application conversion targets the Oracle-specific code that surrounds the database: SQL scripts, stored procedure calls, loader control files, shell scripts, and Java files. When available, coding notes from schema conversion guide changes to object names, types, and calling conventions. Review and test those changes; generated notes don't guarantee correct application behavior.
You can convert database-related application code inside this extension, or hand the work to the GitHub Copilot app modernization extension for a full modernization pass. Converting a loader script or other application file doesn't execute a row-data migration.
Sequence the two passes
For a combined conversion workflow, run schema conversion first so application conversion can use its coding notes and converted object names. Review the schema and resolve required changes before converting application code. If you later edit a PostgreSQL definition, check its application callers again. Rerunning a completed schema conversion isn't supported.
Prerequisites
For schema conversion, follow the tutorial prerequisites for:
- Visual Studio Code, the PostgreSQL extension, supported operating systems, and Copilot sign-in.
- Oracle version, metadata permissions, connectivity, and client configuration.
- Schema validation database, PostgreSQL version, permissions, and extensions.
- Foundry model, resource authentication, and capacity planning.
For application conversion, also make the source application folder available and preserve its original contents before accepting generated edits.
Enable schema conversion
The pgsql.enableMigrations setting controls the Migrations view and its schema and application conversion commands. This setting is enabled by default. The UI retains labels such as Migrations and Create Migration Project for these conversion workflows.
If the Migrations view doesn't appear in the sidebar, open Visual Studio Code settings (Ctrl+, on Windows/Linux, Cmd+, on macOS) and verify that pgsql.enableMigrations is set to true.
Create a schema conversion project
The project wizard collects your source, discovery scope, schema validation database connection, and model configuration. The tutorial is the main walkthrough; use the following entry point and links to navigate it.
Step 1: Project setup
Open the Migrations view in the sidebar.
Start a new project in one of these ways:
- If the workspace doesn't contain a schema conversion project yet, select + Create Migration Project in the view.
- Select the + button in the view toolbar.
- Right-click a workspace folder in Explorer and select Open Migration Project.
Enter a name in the Project Name field.
Select Next: Oracle Connection.
The prerequisite list in this screenshot applies to API-key authentication. You can also use Microsoft Entra ID authentication.
Complete the wizard
Follow the corresponding tutorial step for each page:
| Wizard stage | Instructions |
|---|---|
| Oracle connection and schema selection | Connect to Oracle. |
| Discovery, source permissions, and dependencies | Review Discovery results. |
| Schema validation database and extension checks | Configure the schema validation database. |
| Foundry resource, model, and authentication | Configure the model. |
Warning
Conversion drops schemas that correspond to the selected Oracle schemas by using DROP SCHEMA ... CASCADE and then recreates them. This action deletes existing objects and data in those schemas and can remove dependent objects in other schemas. Use an empty schema validation database or a dedicated, unused schema validation database that contains no objects or data you need to preserve.
Run schema conversion
After you create the project, run schema conversion and review the results in the project.
Extract and convert schemas
- Select Migrate to start extraction and conversion.
- Monitor the extraction and conversion progress.
- When the project shows Schema conversion is complete, select Review conversion summary.
The HTML report opens automatically when conversion finishes. Reopen it by selecting Conversion report on Conversion summary. Review the discovery, extraction, and conversion totals separately; they describe different stages.
Review converted objects
Use Conversion Object Explorer to compare available definitions and read notes for both Converted and Not converted objects. Ask and Fix provide Copilot assistance; Resolve updates a reviewed object's recorded status, and Refresh updates the reports. Review compilation results and deployment inclusion separately.
For dependent-object corrections, package members, manual compilation, and a worked example, follow Conversion Object Explorer.
Prepare deployment
On Conversion summary, select Setup instruction to open the generated deployment instructions and reveal the setup directory. Review the package and tool-generated object files in postgres_ddl, run validate-only checks, and then run the generated deployment script against the destination database you choose on Azure Database for PostgreSQL flexible server or Azure HorizonDB. Setup reads the latest saved contents of these files for deployment, including manual edits and Fix corrections. Files added manually to postgres_ddl are ignored by Setup. Generating setup files doesn't deploy the schema.
Review deployment reports and independently validate data and application behavior before production use. For prerequisites, database modes, and commands, see Deploy converted schemas with the Setup Experience.
Convert application code
Convert Oracle-specific application code (SQL scripts, stored procedures, loader control files, shell scripts, or Java files) to PostgreSQL-compatible equivalents. For a combined conversion workflow, use the reviewed schema output as context. Application conversion is a preview feature.
Choose a conversion method
The extension offers two paths for application code conversion:
- Full app modernization: If you install the GitHub Copilot app modernization extension, select Migrate using app modernization to continue with coding notes from the schema conversion. Select View coding notes to review the generated guidance before proceeding.
- Database-only option: To convert only database-related application code within this extension, select Migrate using PostgreSQL extension.
Convert application code within the extension
- On the Application Migration card, start the application conversion workflow. If a method selector appears, choose Migrate using PostgreSQL extension.
- In the Convert Application page, select Select Oracle Application to Convert and choose the folder that contains Oracle application code.
- Select a PostgreSQL Connection and PostgreSQL Database for conversion context.
- Select Load Databases if the database list is empty.
- Select Convert Application to start the conversion.
Use Copilot tools for application conversion
The extension registers two Copilot language model tools for conversion assistance:
Oracle Client Code Application Converter (
pgsql_migration_oracle_app): Converts Oracle client application code to PostgreSQL equivalents by using prompt templates and coding guidance from schema conversion. Accepts the following parameters:- Application Codebase Folder (required): Location of the code to convert.
- Coding Notes Location Path (optional): Path to coding notes from schema conversion.
- Postgres DB Name (optional): Name of the PostgreSQL database for conversion context.
- Postgres DB Connection (optional): Connection name for the PostgreSQL database.
Show Oracle to Postgres Migration Report (
pgsql_migration_show_report): Displays the schema conversion report. Requires a Path to Report File parameter.
For more information on using Copilot tools, see Copilot integration.
Compare converted files
To view the current schema-conversion output, use Conversion Object Explorer to navigate source-to-target mappings, including objects with multiple target definitions.
To compare converted application files (.sql, .ctl, .sh, .load, or .java), right-click the file in Explorer and select Compare Application Migration File Pairs. Review the original and converted code, and test the application with the corrected PostgreSQL schema.
For projects with the legacy paired-folder layout, Compare DDL Migration File Pairs expects matching paths under folder\oracle\SCHEMA_NAME\DDL-TYPE and folder\postgres\SCHEMA_NAME\DDL-TYPE. This layout isn't the navigation path for the current postgres_ddl package.
Manage conversion projects
Use the Migrations view in the sidebar to manage your projects:
| Action | Description |
|---|---|
| Open Migration Project | Open an existing conversion project in the dashboard. |
| Reveal in Explorer | Show the project folder in the Explorer view. |
| Delete | Remove a conversion project. You're prompted to confirm before deletion. |
| Refresh | Reload the list of conversion projects in the current workspace. |
Related content
- What is Oracle to Azure PostgreSQL schema conversion?
- Tutorial: Convert Oracle schemas to Azure PostgreSQL
- Best practices for Oracle to Azure PostgreSQL schema conversion
- Review converted objects in Conversion Object Explorer
- View the HTML conversion report
- Deploy converted schemas with the Setup Experience
- Oracle to Azure PostgreSQL schema conversion limitations
- Copilot integration
- Connections and identity
- Settings reference
- Copilot tools reference