Skip to content

Add Oracle → PostgreSQL DWH migration tool with daily GitHub Actions schedule#1

Draft
eng-dedalus with Copilot wants to merge 3 commits into
mainfrom
copilot/create-dwh-migration-tool
Draft

Add Oracle → PostgreSQL DWH migration tool with daily GitHub Actions schedule#1
eng-dedalus with Copilot wants to merge 3 commits into
mainfrom
copilot/create-dwh-migration-tool

Conversation

Copilot AI commented Apr 1, 2026

Copy link
Copy Markdown

Implements a Python-based ETL tool to migrate tables from an Oracle DWH to PostgreSQL, schedulable daily via GitHub Actions.

Core modules

  • migrate.py – entry point; streams rows from Oracle in configurable batches using oracledb, bulk-inserts into PostgreSQL via psycopg2.extras.execute_values; supports full (truncate+reload) and incremental (append) modes plus --dry-run
  • type_mapping.py – Oracle → PostgreSQL type conversion; NUMBER(p,0) maps to SMALLINT/INTEGER/BIGINT/NUMERIC by precision; falls back to TEXT for unknown types
  • config.py – all connection params and tuning knobs (PG_SCHEMA, MIGRATION_MODE, MIGRATION_BATCH_SIZE, …) via env vars; no credentials in source

GitHub Actions

  • daily_migration.yml – cron 0 2 * * *; workflow_dispatch lets operators override table list, mode, and dry-run at trigger time; uses a production environment for secrets gating
  • ci.yml – runs pytest tests/ on every push/PR

Usage

# Migrate all tables (full reload)
python migrate.py

# Targeted incremental run
python migrate.py --tables ORDERS,CUSTOMERS --mode incremental

# Validate connectivity without writing data
python migrate.py --dry-run

Notable design choices

  • Oracle SELECT and PostgreSQL INSERT columns are double-quoted to handle reserved words and mixed-case identifiers
  • PG_SCHEMA is decoupled from PG_USER; defaults to public
  • Both workflow jobs set permissions: contents: read (least privilege)
Original prompt

Questo progetto serve a creare uno strumento di migrazione da DWH in Oracle a uno in Postgres. Vorremmo utilizzare uno script python per effettuare la migrazione e possibilmente schedulandola quotidianamente tramite github actions

Copilot AI and others added 2 commits April 1, 2026 14:29
… schedule

Agent-Logs-Url: https://github.com/eng-dedalus/test/sessions/7f993e48-6f10-4fe2-9101-17b4a0803c20

Co-authored-by: eng-dedalus <260377058+eng-dedalus@users.noreply.github.com>
Copilot AI changed the title [WIP] Add DWH migration tool from Oracle to Postgres Add Oracle → PostgreSQL DWH migration tool with daily GitHub Actions schedule Apr 1, 2026
Copilot AI requested a review from eng-dedalus April 1, 2026 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants