20 August 2025

Migrating a live platform from Rails to Phoenix


Considering a move away from Ruby on Rails? Let me tell you about this switch to Elixir and Phoenix and how we managed to pull it off in eight weeks.

The benefits of Phoenix

1. LiveView changes everything about the frontend

Ditch the complexity of maintaining a separate React frontend while still delivering that real-time, interactive experience our users love. No more wrestling with API endpoints for every little interaction—LiveView handles it all seamlessly.

2. Migrating without anyone noticing

Instead of doing a big bang release, we went feature by feature, using a simple Nginx configuration to route /v2 traffic to the new Phoenix app. Our users kept using the original app happily while we slowly but surely moved everything over. Zero downtime, zero drama.

3. Our database didn't skip a beat

One of our biggest concerns was the database migration. Phoenix played nice with our existing Postgres schema using create_if_not_exists, and we just tweaked the timestamp handling to match Rails' conventions (hello, inserted_at: :created_at). Our years of user data stayed exactly where it was.

4. Keeping users logged in

Authentication migrations usually give nightmares, but this one was pretty painless. We switched from Devise to phx.gen.auth, and yes, we had users reset their passwords after the migration. But here's the clever part: we kept users logged in during the transition by routing session cookies through our Rails API for validation. No one got kicked out mid-browse.

5. File uploads just worked

The platform users upload a lot of photos, so we couldn't afford any hiccups with file handling. We replicated Rails' ActiveStorage setup by mirroring the attachments and blobs tables and hooking everything up with ex_aws. Every single uploaded photo made it through the transition intact.

6. Saying goodbye to React (mostly)

We had about 80 React components scattered throughout our Rails app. We kept the two components that really mattered and embedded them into our LiveView templates via NPM. The user experience stayed exactly the same, but our codebase got a whole lot simpler.

The Real Story Behind the Migration

Migrating an entire application is never trivial. But what made this work was our commitment to doing it incrementally and thoughtfully.

The two-month timeline wasn't about rushing—it was about having a clear plan and sticking to it. Every feature migration was tested thoroughly, every edge case was considered, and every user interaction was preserved.

Want a more detailed story?

This is just the highlight reel of how we pulled the Rails-to-Phoenix migration at Purrs.com. If you're thinking about a similar move and want to see the actual implementation details, code snippets, and lessons we learned along the way, I've put together a complete case study.

Related posts