# GitHub's Rails 3.2 to 5.2 Upgrade, Done Live | gen2.dev

> How GitHub moved its main app from Rails 3.2 to 5.2 in a year and a half with no downtime, by running two versions of Rails side by side in one codebase.

Source: https://gen2.dev/cases/github-rails-upgrade/

---

Case file 40

# GitHub's Rails upgrade: a year and a half without stopping the site

GitHub's main application ran on a Rails version years past its support. Instead of a long-running branch, the team made the app run on two versions of Rails at once and moved it across one minor version at a time.

![Slide: one codebase running on Rails 3.2 and the next version side by side, stepping through 4.0, 4.1 and 4.2 to 5.2 over a year and a half with no downtime.](https://gen2.dev/img/case-github-rails-upgrade.png)

Not every Gen 2 is a rewrite. Sometimes the new generation is the same application on a new version of the framework under it, and the hard part is getting there while the site keeps shipping. GitHub's own account is unusually detailed.

## Gen 1

Eileen Uchitelle's post describes the starting point: GitHub's main application was on Rails 3.2, and "the GitHub codebase is 10 years old." Old versions stop getting fixes. The post notes that GitHub had "been backporting security fixes to 3.2," doing for itself what the Rails team no longer did.

The scale ruled out the usual approach: "Since GitHub is so important to our community, we can't stop feature development or bug fixes in order to upgrade Rails."

## The approach: run both versions

Instead of a long-running branch, the team made the app boot on two versions at once. "We created two Gemfile.lock's: one for the current version Gemfile.lock and one for the future version Gemfile\_next.lock." Code that differed between versions was wrapped in checks such as `if GitHub.rails_3_2?`.

That made the upgrade a series of small, continuously merged changes rather than a branch that drifted for months: "The dual booting allows us to regularly deploy changes for the next version to GitHub without requiring long running branches or altering how production works." This is [branch by abstraction](https://gen2.dev/guide/branch-by-abstraction/) applied to a framework.

## One minor version at a time

"Each time we got a minor version of Rails green we'd make the CI job required for all pushes to the GitHub application and start work on the next version." Once a version passed, nobody could break it again. Only two versions were deployed: 4.2, "the first version of Rails that hadn't been EOL'd yet," and 5.2.

## Rolling it out

Each release went through people first, then a slice of production. Volunteers from each team click-tested their areas, then "we deployed in off-hours to a percentage of production servers." The bar for finishing was concrete: "We merged the upgrade once we could deploy to full production for 30 minutes at peak traffic with no visible impact."

The result: "minimal customer impact and no down time." It was not painless: "we had issues with CI, local development, slow queries, and other problems that didn't show up in our CI builds or click testing."

## How long, and why

"The Rails upgrade took a year and a half." The two halves were very different: "3.2 to 4.2 took 1 year, 4.2 to 5.2 only took 5 months." The post gives three reasons: some versions had major breaking changes, ten years of technical debt, and nobody knew at first what the work needed.

The team grew as it went. "The project originally began with 1 full-time engineer and a small army of volunteers. We grew that team to 4 full-time engineers plus the volunteers."

## What came after

The real Gen 2 was the process. By 2023, Adam Hess wrote: "nearly every week one of those deploys is a Rails upgrade." An automated pull request each Monday moves the app to the newest commit on Rails' main branch. The next big upgrade never has to happen, because the small ones never stop.

## What made it work

-   **Two versions in one codebase,** so every change shipped to production instead of waiting on a branch.
-   **A ratchet:** once a version's tests passed, they became required.
-   **A staged rollout** with a clear finish line: 30 minutes at peak with no visible impact.
-   **Volunteers from every team,** so knowledge of the new version spread instead of sitting with one group.

## What to take from it

-   **Upgrade in small steps,** one version at a time. GitHub's own advice: "Upgrade early and upgrade often."
-   **Do not let the framework fall years behind.** The year from 3.2 to 4.2 was the price of waiting.
-   **Keep the machinery after you finish.** The dual-boot setup became a weekly habit.
-   **A framework upgrade is a [running two systems](https://gen2.dev/guide/running-two-systems/) project** inside one codebase, and needs the same discipline.

## Sources

1.  [Eileen M. Uchitelle - Upgrading GitHub from Rails 3.2 to 5.2 (GitHub Blog, September 28, 2018)](https://github.blog/engineering/architecture-optimization/upgrading-github-from-rails-3-2-to-5-2/)
2.  [Adam Hess - Building GitHub with Ruby and Rails (GitHub Blog, April 6, 2023)](https://github.blog/engineering/architecture-optimization/building-github-with-ruby-and-rails/) - the weekly upgrade to the newest Rails
3.  [Ruby on Rails - Maintenance Policy](https://guides.rubyonrails.org/maintenance_policy.html) - why old Rails versions stop getting security fixes
4.  [Ruby on Rails - Upgrading Ruby on Rails guide](https://guides.rubyonrails.org/upgrading_ruby_on_rails.html) - upgrading one version at a time

Last updated November 29, 2026.

## Scorecard

Worked, slowly

Gen 1

GitHub.com on Rails 3.2, a ten-year-old codebase with security fixes backported by GitHub itself

Gen 2

The same application on Rails 5.2.1, and later a process that upgrades to the newest Rails every week

Approach

Dual boot the app on the current and next Rails version, upgrade one minor version at a time, and roll each out to a share of production servers

How long

A year and a half, finished August 15, 2018: 3.2 to 4.2 took a year, 4.2 to 5.2 took five months

Verdict

It worked, with no downtime, but took a year and a half; the lasting result was a habit of upgrading every week.

## More case files

-   [Netscape 6](https://gen2.dev/cases/netscape-6/)
-   [Python 2 to 3](https://gen2.dev/cases/python-2-to-3/)
-   [Firefox Quantum](https://gen2.dev/cases/firefox-quantum/)
-   [Perl 6 and Raku](https://gen2.dev/cases/perl-6-raku/)
-   [AngularJS to Angular](https://gen2.dev/cases/angularjs-to-angular/)
-   [Windows Longhorn](https://gen2.dev/cases/windows-longhorn/)
-   [Digg v4](https://gen2.dev/cases/digg-v4/)
-   [Twitter to the JVM](https://gen2.dev/cases/twitter-jvm/)
-   [Basecamp](https://gen2.dev/cases/basecamp/)
-   [IPv4 to IPv6](https://gen2.dev/cases/ipv6/)
-   [VB6 to VB.NET](https://gen2.dev/cases/vb6-to-vb-net/)
-   [HTTP/2 and HTTP/3](https://gen2.dev/cases/http-2-and-3/)
-   [K-12 browser rewrite](https://gen2.dev/cases/k12-browser-rewrite/)
-   [Mac OS X](https://gen2.dev/cases/mac-os-x/)
-   [Microsoft Edge](https://gen2.dev/cases/edge-chromium/)
-   [Winamp3](https://gen2.dev/cases/winamp3/)
-   [Slack desktop](https://gen2.dev/cases/slack-desktop/)
-   [Evernote 10](https://gen2.dev/cases/evernote/)
-   [Uber rider app](https://gen2.dev/cases/uber-rider-app/)
-   [HealthCare.gov](https://gen2.dev/cases/healthcare-gov/)
-   [Thunderbird Supernova](https://gen2.dev/cases/thunderbird-supernova/)
-   [Skype](https://gen2.dev/cases/skype-cloud/)
-   [Sonos app (2024)](https://gen2.dev/cases/sonos-app-2024/)
-   [FBI Virtual Case File](https://gen2.dev/cases/fbi-virtual-case-file/)
-   [LinkedIn Inversion](https://gen2.dev/cases/linkedin-project-inversion/)
-   [Netflix to AWS](https://gen2.dev/cases/netflix-cloud-migration/)
-   [TSB migration](https://gen2.dev/cases/tsb-migration/)
-   [Phoenix pay system](https://gen2.dev/cases/phoenix-pay/)
-   [Universal Credit](https://gen2.dev/cases/universal-credit/)
-   [Queensland Health payroll](https://gen2.dev/cases/queensland-health-payroll/)
-   [Facebook for iOS](https://gen2.dev/cases/facebook-native-ios/)
-   [New Microsoft Teams](https://gen2.dev/cases/microsoft-teams-2/)
-   [Dropbox to Python 3](https://gen2.dev/cases/dropbox-python-3/)
-   [Instagram to Python 3](https://gen2.dev/cases/instagram-python-3/)
-   [Discord Go to Rust](https://gen2.dev/cases/discord-go-to-rust/)
-   [Reddit Redesign](https://gen2.dev/cases/reddit-redesign/)
-   [GetPranks](https://gen2.dev/cases/getpranks/)
-   [37signals cloud exit](https://gen2.dev/cases/37signals-cloud-exit/)
-   [IRS Individual Master File](https://gen2.dev/cases/irs-individual-master-file/)
-   [Knight Capital](https://gen2.dev/cases/knight-capital/)
-   [NHS National Programme for IT](https://gen2.dev/cases/nhs-national-programme-for-it/)
-   [Air Force ECSS](https://gen2.dev/cases/air-force-ecss/)
-   [Java SaaS upgrade](https://gen2.dev/cases/java-saas-upgrade/)
-   [ActiveX to WebRTC](https://gen2.dev/cases/activex-to-webrtc/)
-   [All case files](https://gen2.dev/cases/)
