How We Took Forge from Rails 5.2 to Rails 8: a technical overview of the key stages
The interesting problem was not how to upgrade Rails. It was how to make a large migration bounded enough that it became safe to execute.
How We Took Forge from Rails 5.2 to Rails 8
I first assessed the Forge API migration in August 2025 and marked it as HIGH RISK, with an estimated timeline of six to twelve months. After focused work on 26, 27 July 2026, I took the codebase from Ruby 2.5.1 and Rails 5.2.4 to Ruby 3.4.5 and Rails 8.0.5.
The two days are not the story. The year that changed the risk equation is.
If you read that as a migration diary, you will miss the point. The execution window was short because I had already done the rest of the work. This post is about what "everything else" actually means when you are moving a production API that handles deployments, billing, SSL, domain management and customer accounts.
What the August 2025 assessment actually said
We have already covered the broader Forge modernisation programme in earlier posts. The flagship post describes how we turned a technical due diligence lens on Beach, and the decision framework post explains why refactor, not rewrite, was the right verdict for the Forge API.
The August 2025 assessment is worth dwelling on briefly. I called it high risk and high complexity, with six to twelve months recommended. That classification was not pessimistic. The Forge API contained around 35,000 lines of Ruby, years of business logic covering critical customer-facing behaviour, and a dependency surface that had accumulated across more than a decade of production operation. Ruby 2.5.1 had been end-of-life since March 2021. Rails 5.2 was approaching eight years old.
Jumping from Rails 5.2 to Rails 8 means crossing five major framework versions: 6.0, 6.1, 7.0, 7.1, and 8.0. Each one introduced breaking changes, shifted conventions, and changed the underlying dependencies. The assessment was not saying the work was impossible. It was saying that the work was complex enough to demand structure before speed.
What the refactor verdict required
The decision framework concluded that the Forge API should be refactored, not rewritten. The interface had value: the API contract, the behaviour it promised, the compatibility guarantees it carried. The implementation beneath that contract could be modernised without replacing the surface that other systems depended on.
That verdict immediately implied a constraint. A refactor has to preserve behaviour. Which meant we needed to understand the behaviour first.
That is a harder task than it sounds when the codebase is a decade old and the person who made certain decisions is no longer available to explain them. Some behaviour is documented. Some is captured in tests. A significant portion lives in the accumulated choices of production operation: the edge cases that were handled, the error responses that clients learned to depend on, the request shapes that had never appeared in a spec but were definitely being sent by someone somewhere.
Before we could modernise confidently, we needed a baseline. Not a perfect audit. a working model of what the system was actually doing, well enough to know if we had broken it.
The year before the execution window
Ember removal
The first prerequisite was not a Rails task at all. It was JavaScript.
In 2013, Forge's product interface was an Ember.js application shipped inside the Rails app. We rebuilt that interface in 2024 and separated it from the Rails application, but the Ember code still lived in the stack, bringing with it a collection of outdated JavaScript dependencies that complicated the dependency graph and slowed down any modernisation work.
Removing Ember was not a Rails upgrade task, but it was a prerequisite for one. Once it was gone, the application became a much cleaner proposition: a JSON API, ActiveAdmin, Devise authentication, Sidekiq background workers, and a substantial amount of business logic that had been exercised in production for years. The scope of what needed to survive the migration was now legible.
Establishing the RSpec baseline
Confidence in a refactor comes from tests. The existing test suite was meaningful, but it was not comprehensive enough to serve as the sole safety net for a multi-version Rails jump. We invested time in shoring up RSpec coverage across the critical paths. deployments, billing events, SSL operations, domain behaviour.
The goal was not 100% coverage. It was signal fidelity: if something broke in the migration, the test suite needed to tell us before production did.
Dependency archaeology
The dependency graph for a Rails 5.2 application that has been in production since 2013 is not clean. Gems accumulate. Versions drift. Some dependencies are locked because something once broke when they were updated and the fix was never revisited. Some are transitive dependencies of dependencies, present in the lockfile for reasons that have been lost to time.
We worked through the full dependency surface systematically. For each major gem: what version were we running, what version existed in the Rails 8 ecosystem, what changes had happened in between, and whether those changes were breaking for our usage.
AI tooling accelerated this work considerably. Scanning changelogs, identifying compatibility breaking points, cross-referencing deprecation notices. Tasks that would have taken days of careful reading were compressed. But the archaeology itself required judgment that the tooling could not supply. Whether a behaviour change in a gem was actually triggered by our usage patterns, whether a deprecation warning was genuinely benign for us, whether an API surface we relied on had a clean migration path. those decisions required understanding the application.
The lesson from this stage: AI acceleration is only safe when the architecture gives it room to move fast. We were not speeding through decisions. We were speeding through information gathering so that the decisions themselves could be made on the right evidence.
Key concerns in the dependency surface included authentication gem evolution across the Devise generations, ActiveAdmin compatibility with the later Rails versions, Sidekiq and Redis alignment, and the asset pipeline shift from Sprockets to Propshaft that Rails 7 introduced and Rails 8 carried forward.
JSON contract compatibility
The Forge API serves Hammer for Mac, the Forge CLI, internal Forge tooling, and potentially other callers whose precise request patterns we did not have complete visibility into. Any breaking change to JSON response shapes, datetime formatting, error structures, or authentication behaviour would affect those callers.
We mapped the API surface explicitly: every endpoint, every request shape we knew about, every response format we were responsible for. We ran compatibility checks against the new Rails version's serialization defaults. We identified where Rails behaviour changes could produce subtle output differences that would not surface as errors in our own tests but would break callers who had learned to depend on specific response shapes.
This was the part of the preparation that most directly justified the refactor verdict. A rewrite would have put every one of these behaviours at risk simultaneously. A refactor, done carefully, let us move the implementation without touching the contract.
Sidekiq, Redis, and background job behaviour
Background jobs in Forge handle deployment lifecycle events, certificate operations, billing processing, and other operations where failure is visible to customers and retry semantics matter. The Sidekiq version compatible with our Ruby and Rails version was constrained, and the upgrade path had implications for queue configuration, job serialization, and retry behaviour.
We traced the Sidekiq upgrade path alongside the Rails upgrade path and verified that existing job definitions would survive the transition without changes to serialized job arguments or retry logic. Background job behaviour that is invisible when it works correctly becomes very visible when it changes unexpectedly.
Environment and configuration
Rails manages secrets, credentials, and environment configuration differently across versions. The transition from Rails 5.2 credentials management through the changes introduced in later versions required explicit work to ensure that our production configuration would survive the upgrade without silent failures.
This is unglamorous work. It does not produce interesting code changes. But it is the kind of preparation that prevents a successful migration from being undermined by a configuration assumption that was silently wrong.
Parallel environment on Render
The most important structural decision was to stand up a parallel Render environment running the target Rails and Ruby versions before we touched production.
This sounds obvious in retrospect. It was critical in practice. The parallel environment let us run the migrated application against production data snapshots, smoke-test the full API surface, and verify end-to-end behaviour under realistic conditions. without any of this activity being visible to production traffic.
We ran the migrated stack against production database snapshots. We compared API responses. We ran the test suite. We exercised the deployment pipeline end-to-end. Every failure we found in the parallel environment was a failure that would have happened in production instead.
The rollback strategy was explicit from the start. We knew what a rollback would require. We had the database snapshots to support it. We had not made any irreversible changes. That clarity about the exit path is part of what made the execution window possible: we were not committing to something we did not know how to undo.
A weekend in late July: the execution window
By late July 2026, the risk equation had changed.
The test suite had meaningful coverage of the critical paths. The dependency surface was understood. The JSON contract had been validated. Background job behaviour had been traced. The parallel environment had been exercised. We had a rollback strategy we could execute.
The execution window. upgrading the production codebase from Ruby 2.5.1 and Rails 5.2.4 to Ruby 3.4.5 and Rails 8.0.5. happened across 26–27 July.
This is where AI tooling played its most visible role. Once the dependency surface was understood and the contract validated, the mechanical work of resolving remaining compatibility issues, updating deprecated API calls, adjusting configurations, and running iterative test cycles was significantly accelerated by AI assistance. We were not making judgment calls under speed pressure. The judgment calls had already been made. We were executing a plan whose risk was already bounded.
The two days were not a sprint against unknown risk. They were the execution phase of a programme that had spent months converting unknown risk into understood, managed work.
In late August: Render cutover
The code migration and the production cutover were separate events.
The migrated application ran in the parallel Render environment for several weeks. We continued smoke testing. We compared production behaviour. We ran the test suite repeatedly. We looked for anomalies.
In late August, we moved production traffic to the Render environment running Rails 8.
The cutover itself was not the dramatic moment. The decision to cut over. the judgment that we had done enough validation and the risk was at an acceptable level. was the moment that mattered. That decision was made possible by the months of preparation and the weeks of parallel running.
Cutover went cleanly.
What AI acceleration actually means
There is a reading of this post that is tempting and wrong: that AI tools made a complex migration simple.
They did not.
AI assistance compressed information-gathering tasks. It accelerated dependency archaeology. It helped generate test scaffolding. It sped up the identification of deprecated patterns in the codebase. Those are real contributions, and they moved the timeline.
But AI tooling did not design the parallel environment strategy. It did not reason about rollback paths. It did not make the judgment that the JSON contract needed explicit validation before we moved. It did not decide that the RSpec baseline needed to be shored up before we had enough confidence to proceed. It did not understand why the Ember removal was a prerequisite.
The architecture that made the execution window safe was human work. The preparation that reduced the risk was human work. The AI tools operated inside a structure that had already been designed to make their contributions safe.
AI acceleration is only safe when the architecture gives it room to move fast. We were not speeding through decisions. We were speeding through information gathering so that the decisions themselves could be made on the right evidence.
That distinction is the important one. A tool that lets you move faster on work that has not been properly bounded is a tool that helps you create problems faster. A tool that lets you move faster on work that has already been properly bounded is a force multiplier.
The year of preparation was what made the execution window possible.
The broader lesson
We chose to refactor the Forge API because the value lived in the contract, not the implementation. That verdict was correct, and this migration is the evidence for it.
The application that ran in production in July 2026 was not the same code that ran in 2013. But the API contract it delivered was compatible with everything that had learned to depend on it. Deployments still worked. Billing still worked. SSL operations still worked. Domain management still worked. Customer accounts still worked. The surface that mattered was preserved. The implementation underneath it was modernised.
That is what a refactor is for.
The other lesson is about timing and sequence. We did not move quickly because we were cavalier about risk. We moved quickly because we had spent time converting vague risk into understood, bounded problems. The August 2025 assessment was right: the migration required six to twelve months. It was simply that most of that time was spent on understanding and preparation, not on the migration itself.
The next post in this series covers a different kind of modernisation problem. one where the architecture itself was the issue, and refactoring would not have been enough. The Hammer Cloud rebuild, and why preserving the contract meant replacing the machinery behind it entirely.
Forge is Beach's web deployment platform. This post is part of a series on how we modernised the platform to serve as the foundation for Gleo and the next chapter of Beach.