---
title: "How We Migrated to Active Record 4"
description: "Heroku Platform API had remained on Active Record 2.3.18, released in March 2013, creating maintenance and security burdens as support ended and custom query infrastructure replaced newer features. The team moved first to Active Record 3.0.20, preserving 2.x APIs, then directly to 4.2.4, using a feature branch, console-driven fixes, automated and acceptance tests, private deployments, staging, and a partial production rollout. The first step took one engineer about two weeks, while the second took two engineers about two weeks; deployment had no downtime but briefly required a rollback for an acts_as_paranoid bug. Performance improved 18% from 2.3.18 to 3.0.20 but worsened 13% from 3.0.20 to 4.2.4, challenging micro-benchmark expectations. The upgrade ultimately left performance at the same overall level, removed patches, restored supported status, and made future updates and training easier."
---

# How We Migrated to Active Record 4

[Heroku](https://yomu.fyi/company/heroku) · Owen Ou · Nov 4, 2015

**Type:** Problem & solution

## Summary

Heroku Platform API had remained on Active Record 2.3.18, released in March 2013, creating maintenance and security burdens as support ended and custom query infrastructure replaced newer features. The team moved first to Active Record 3.0.20, preserving 2.x APIs, then directly to 4.2.4, using a feature branch, console-driven fixes, automated and acceptance tests, private deployments, staging, and a partial production rollout. The first step took one engineer about two weeks, while the second took two engineers about two weeks; deployment had no downtime but briefly required a rollback for an acts\_as\_paranoid bug. Performance improved 18% from 2.3.18 to 3.0.20 but worsened 13% from 3.0.20 to 4.2.4, challenging micro-benchmark expectations. The upgrade ultimately left performance at the same overall level, removed patches, restored supported status, and made future updates and training easier.

## Context

The Heroku Platform API was tied to Active Record 2.3.18, whose support had ended. The team had to backport security patches and features, build custom query infrastructure for filters, and maintain an increasingly burdensome legacy dependency.

## Approach / What changed

The upgrade proceeded from Active Record 2.3.18 to 3.0.20, then directly to 4.2.4. The team used a feature branch, iterative console and test fixes, automated and acceptance testing, private deployments, staging with production-like data, and a partial production rollout to reduce risk and avoid downtime.

## Takeaways

- Active Record 3.0.20 preserved the Active Record 2.x APIs and took one engineer about two weeks to adopt; the subsequent move to 4.2.4 took two engineers about two weeks.
- Performance improved 18% from Active Record 2.3.18 to 3.0.20 but was 13% worse with 4.2.4, showing that micro-benchmarks did not predict the application's overall performance.
- The migration removed many Active Record patches, restored security-supported software and query-building features, and made later updates and employee training easier.

**Tags:** [Migrations](https://yomu.fyi/topic/migration), [Performance](https://yomu.fyi/topic/performance), [Ruby on Rails](https://yomu.fyi/topic/ruby-on-rails), [Testing](https://yomu.fyi/topic/testing)

- Source: [Heroku](https://www.heroku.com/blog/upgrading-to-active-record-4)
- Source URL: https://www.heroku.com/blog/upgrading-to-active-record-4
- Ingested by Yomu: 2026-09-09T14:24:23.219Z

[Read original post](https://www.heroku.com/blog/upgrading-to-active-record-4)
