Skip to content

Instantly share code, notes, and snippets.

View discoposse's full-sized avatar
💭
Life happens. How you interpret the results is what you have control over.

Eric Wright discoposse

💭
Life happens. How you interpret the results is what you have control over.
View GitHub Profile
@discoposse
discoposse / README.md
Created April 29, 2019 01:41 — forked from tristanm/README.md
Migrating a Rails project from MySQL to PostgreSQL

Migrating a Rails project from MySQL to PostgreSQL

This brief guide is written from my own experience with migrating a large (~5GB) MySQL database to PostgreSQL for a Rails project.

No warranties, guarantees, support etc. Use at your own risk and, as always, ENSURE YOU MAKE BACKUPS FIRST!

I chose [pgloader][1] because it's extremely fast. YMMV.

  1. Replace mysql2 gem with pg in Gemfile.
  2. Update config/database.yml for PostgreSQL. I used [Rails' template][2] as a starting point.