db-migration-oracle-postgres

Migrate Ruby on Rails applications from Oracle Database to PostgreSQL.

21|2|Updated May 24, 2026
One-click install
npx skills add https://github.com/sandeepmvl/rails-skills --skill db-migration-oracle-postgres
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: db-migration-oracle-postgres
Source: https://github.com/sandeepmvl/rails-skills/tree/main/skills/23-db-migration-oracle-postgres
Command: npx skills add https://github.com/sandeepmvl/rails-skills --skill db-migration-oracle-postgres

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates the high risk and manual effort of migrating Ruby on Rails applications from Oracle Database to PostgreSQL, which involves complex schema type mapping, PL/SQL logic conversion, adapter swaps, and safe production cutover to avoid data loss, broken functionality, or numeric precision errors.

Core Features & Use Cases

  • Schema & Data Conversion: Uses ora2pg to automatically map Oracle types (NUMBER, VARCHAR2, CLOB/BLOB) to PostgreSQL equivalents (BIGINT/DECIMAL, VARCHAR, TEXT/BYTEA) and convert schema, sequences, indexes, and bulk data.
  • PL/SQL Logic Porting: Guides manual translation of Oracle PL/SQL packages, triggers, and hierarchical queries (CONNECT BY) to PostgreSQL's PL/pgSQL and WITH RECURSIVE syntax, with guidance to move database logic to Ruby where testable and maintainable.
  • Zero-Downtime Cutover: Implements dual-write cutover patterns to validate data consistency before switching primary databases, with guardrails to avoid common pitfalls like untranslated PL/SQL packages or NUMBER precision drift. Use case: A Rails team with an enterprise app on Oracle can use this Skill to plan and execute a full migration to PostgreSQL in 4-12 weeks, avoiding costly rework from untranslated database logic or data type mismatches.

Quick Start

Use the db-migration-oracle-postgres skill to build a full migration plan for your Rails app moving from Oracle to PostgreSQL, including ora2pg configuration, PL/SQL audit steps, and dual-write cutover procedures.

Frequently Asked Questions about db-migration-oracle-postgres

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate a Rails application from Oracle to PostgreSQL without downtime?

Migrate Rails applications from Oracle to PostgreSQL without downtime by implementing a dual-write cutover pattern, which validates data consistency between both databases before switching the primary ActiveRecord adapter.

How do I map Oracle NUMBER and CLOB types to PostgreSQL in Rails?

Map Oracle NUMBER and CLOB types to PostgreSQL using BIGINT/DECIMAL and TEXT respectively during schema conversion, ensuring numeric precision is preserved and preventing data drift when updating Rails models.

What is the best way to convert Oracle PL/SQL packages to PostgreSQL for Rails?

Convert Oracle PL/SQL packages to PostgreSQL by manually translating the logic into PL/pgSQL, or move the database logic into Ruby on Rails where it is more testable and maintainable for long-term development.

How do I translate Oracle CONNECT BY hierarchical queries to PostgreSQL?

Translate Oracle CONNECT BY hierarchical queries to PostgreSQL by replacing the syntax with WITH RECURSIVE Common Table Expressions, which provide equivalent tree traversal capabilities in standard SQL.

Can I use ora2pg to migrate schema and data for a Rails app?

Use ora2pg to automatically map Oracle types, convert schema structures, migrate sequences and indexes, and execute bulk data conversion when moving a Ruby on Rails application to PostgreSQL.

Why does Oracle to PostgreSQL migration cause numeric precision loss in Rails?

Numeric precision loss occurs during Oracle to PostgreSQL migration when NUMBER types are improperly mapped, so using DECIMAL or BIGINT mapping prevents data drift and ensures ActiveRecord validation accuracy.