Deploy converted schemas with the Setup Experience

The Schema Conversion Setup Experience automatically generates instructions and scripts as the conversion workflow finishes. Use these files to deploy converted schemas to Azure Database for PostgreSQL flexible server or Azure HorizonDB. Generating the files doesn't deploy the schemas to your destination. You review them and run the generated PowerShell or Bash script in your deployment environment.

For instructions on opening the setup files from a completed conversion, see Prepare deployment with the Setup Experience in the tutorial.

Review the generated files

The setup directory depends on how many Oracle schemas you select for conversion. Use the applicable path relative to the workspace root:

Oracle schema selection Setup directory
One schema selected .github\postgres-migrations\<migration-project>\artifacts\oracle\<schema-name>\setup
Multiple schemas selected .github\postgres-migrations\<migration-project>\artifacts\oracle\_migration\setup

Replace <migration-project> with the schema conversion project folder name, such as Mig001. If you select one schema, replace <schema-name> with the selected Oracle schema folder name, such as HR. If you select multiple schemas, _migration is the actual folder name, not a placeholder.

The location reflects the selected Oracle schemas, not the number of PostgreSQL schemas included in the package. Review setup_instructions.md for the package's deployment scope.

File or directory Purpose
setup_instructions.md Deployment-specific prerequisites, commands, optional parameters, and troubleshooting guidance.
setup.ps1 Deployment runner for Windows PowerShell.
setup.sh Deployment runner for Bash on Linux or macOS.
sql Supporting readiness checks, extension scripts, verification queries, and manifests used by the runners.
reports and logs Outputs written when you run the setup scripts.

Keep the setup directory inside the complete schema conversion project. Copying only the setup directory isn't sufficient because the runners use the tool-generated object files in postgres_ddl.

The Setup instruction action and the PowerShell and Bash runners remain the deployment entry points. If you transfer the project to another environment, preserve its directory structure and follow your organization's data-handling requirements. Remove credentials and other secrets from files you share.

Identify the SQL to deploy

For converted objects, Setup considers only DDL files generated by the Schema Conversion tool. When deployment runs, it reads the latest saved contents of those files in postgres_ddl, including manual edits and Fix corrections made after setup files were generated. Setup ignores files added manually to postgres_ddl.

  1. On Conversion summary, select Setup instruction to open setup_instructions.md and reveal the setup directory.
  2. In workspace Explorer, open the enclosing .github\postgres-migrations\<migration-project> folder and locate postgres_ddl. Use Conversion Object Explorer to match source objects to generated target files.
  3. Review the mapped, tool-generated files and confirm that they contain your tested object and dependency corrections. Save all changes before running setup.
  4. Review incomplete definitions, placeholders, and missing dependencies before running setup.

Follow the generated instructions for deployment scope and order rather than assuming every tool-generated file is included or executes successfully. Saving a correction or selecting Resolve doesn't itself deploy the object.

Use the setup deployment report and verification output to confirm what was applied. Conversion counts, file counts, and deployed-object counts can differ.

Deploy manually implemented PostgreSQL replacements that don't map to tool-generated files separately from Setup. Plan the order of the replacement SQL and generated SQL together so required objects exist before dependent definitions run.

Prepare the destination

Use the requirements in your generated setup_instructions.md, rather than copying requirements from another conversion:

  • Server and client versions. Prepare an Azure Database for PostgreSQL flexible server or Azure HorizonDB cluster with the required PostgreSQL version. The psql client's major version must match the conversion-server major version recorded in the generated setup package. Install that client on the computer that runs setup, and make it available on PATH. Setup can create a database, but doesn't provision the Azure server or cluster.
  • Shell and file access. Use PowerShell 5.1 or later on Windows, or Bash on Linux or macOS. The runner needs write access to its logs and reports directories.
  • Network access. Allow the setup computer to connect to the destination endpoint and PostgreSQL port. For Azure HorizonDB, use the cluster's read-write endpoint.
  • Extensions. Review the required extensions and allow the ones supported by your destination service before deployment. See Allow extensions in Azure Database for PostgreSQL or Allow extensions in Azure HorizonDB.
  • Permissions. Use an account with the database, schema, object-creation, and extension-installation permissions specified in the generated instructions. New-database mode also requires permission to create the database.
  • Authentication. Use the script's hidden password prompt, a PostgreSQL password file, or your organization's approved secret-management process. Don't embed passwords in deployment scripts.

Confirm that the client is available:

psql --version

The generated instructions reflect the conversion environment, including its PostgreSQL version and extension requirements. Review any destination differences before deployment.

Choose a database mode

Both runners support these modes:

Mode Behavior
New database The default mode. Creates a database on the selected destination service when you deploy. The requested database name must not already exist.
Existing database Uses the database you specify. If the target schemas contain objects, setup requires explicit acknowledgment before continuing.

For an interactive run, the script prompts for missing host, user, and database values. Review the displayed destination, database mode, schemas, and operation before confirming.

Check readiness without deploying

Open a terminal in the generated setup directory. Choose the command for your operating system and intended database mode:

Database mode Windows PowerShell Linux or macOS
New database .\setup.ps1 -ValidateOnly bash setup.sh --validate-only
Existing database .\setup.ps1 -DatabaseMode existing -ValidateOnly bash setup.sh --database-mode existing --validate-only

Validate-only mode connects to the server and writes local reports and logs. It doesn't create the target database, install extensions, or deploy converted objects.

The readiness checks cover connectivity, PostgreSQL version, database encoding and locale settings, permissions, target-schema occupancy, and extension availability. Review warnings as well as blocking failures.

In new-database mode, validation uses the maintenance database because the destination database doesn't exist yet. Checks that require the destination database are marked as skipped. A successful validate-only run isn't confirmation that those skipped checks passed.

When validation completes successfully, review validation_report_<timestamp>.md in the reports directory. Resolve reported issues before deployment. If validation stops early, check the console output first, then any log or report that was created.

Deploy the converted schemas

Use the same destination and database mode that you checked. From the setup directory, run the appropriate command without -ValidateOnly (PowerShell) or --validate-only (Bash):

Database mode Windows PowerShell Linux or macOS
New database .\setup.ps1 bash setup.sh
Existing database .\setup.ps1 -DatabaseMode existing bash setup.sh --database-mode existing

The runner prepares the database, checks readiness, installs required supported extensions, executes the latest saved SQL from the tool-generated object files in postgres_ddl, and verifies the resulting objects and extensions.

Review the tool-generated object files in postgres_ddl before approving a non-empty destination because their SQL can change existing objects.

Important

Both database modes can leave changes behind after a failure. In new-database mode, setup creates the database before destination readiness checks, so a failed check can leave that database in place. Deployment SQL can also apply changes in separate transactions. Review the destination state before retrying; don't assume a failed deployment rolled back earlier changes.

Use setup_instructions.md for optional port, TLS, locale, and automation parameters. For a non-interactive run, provide the host, user, database, and authentication details in advance. A non-empty existing target also requires explicit acknowledgment through -AllowNonEmptyExisting on Windows or --allow-nonempty-existing on Linux or macOS.

Review deployment results

Read the deployment results before continuing to data or application validation. A conversion status alone doesn't confirm deployment to this destination.

Directory Output What to review
reports deployment_report_<timestamp>.md Deployed and not-deployed totals, extension results, results by object type, and reasons objects weren't deployed.
reports verification_<timestamp>.csv Detailed object-verification results.
reports extensions_<timestamp>.csv Detailed extension results.
reports preflight_<timestamp>.csv Readiness-check results.
logs setup_<timestamp>.log Execution messages and errors.

Validate-only runs produce a validation report instead of a deployment report. An early failure, such as a file-access or shell-version problem, might leave only console output.

Use the runner's exit code together with these outputs:

Exit code Meaning
0 The requested operation succeeded. For validate-only, readiness validation succeeded without deployment.
1 Input, client, or user-cancellation error.
2 Setup-package/configuration, connection, database, readiness-check, or extension-installation failure.
3 Deployment, verification, reporting, or unexpected runner error.
4 Verification identified objects or extensions that weren't deployed.

Continue automation only for exit code 0. For any other code, review the available outputs and resolve the reported issues before proceeding.

Recover from a failed setup run

Save the console output, logs, and reports before retrying. Identify the last completed stage and inspect the destination; an exit code alone doesn't tell you what changed.

Failure point Recovery action
Input or readiness checks before destination changes Correct the reported client, connectivity, permission, or configuration problem. Run validate-only again with the same intended destination and mode.
New database created, then a later check fails The database name can now exist. Don't repeat new-database mode blindly. Inspect the database, and use existing-database mode only if you intend to continue with that database and its current contents.
Extension installation, SQL execution, or object verification Inspect what was applied and what remains missing. Correct the underlying issue and review whether reapplying each affected statement is safe. Don't assume automatic rollback or that the full package can be rerun without conflicts.
Report generation or file access after SQL execution Check the database before treating the operation as not deployed. Fix the output-path or permissions problem and reconcile the available execution and verification results before deciding what to rerun.

Acknowledging an existing database permits setup to continue against a non-empty destination; it isn't a recovery or rollback mechanism. Don't drop a database or schema as a generic retry step. If you choose to recreate anything, first verify its contents, dependencies, and your backup and restore plan.

After recovery, account for every required object and extension, including corrections deployed separately, and complete application and data validation.

Validate the deployed schema

Successful setup doesn't establish behavioral equivalence with Oracle or production readiness. Independently test data handling, dependencies, business logic, and application behavior in the destination environment.

Review any objects or extensions that weren't deployed and complete their remediation. Apply separately managed security configuration and revoke temporary setup privileges when they're no longer required.