Skip to content

Instantly share code, notes, and snippets.

View prestidigitation's full-sized avatar

Alexander Rowland prestidigitation

  • Greater Los Angeles, CA
View GitHub Profile
@prestidigitation
prestidigitation / README.md
Created February 9, 2021 22:04 — 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.