Stay Ahead in Ruby!
From development processes to the most useful gems, get it all straight in your inbox. Join our Ruby blog today!

Skip to main content

How to plan Ruby on Rails upgrade

·3 mins
Attention! This article might be outdated, refer to latest documentation if solution does not work.
How to plan Ruby on Rails upgrade - cover image

When it is time to upgrade Ruby on Rails? #

One of the main reasons to upgrade is the end of Security Support for the Ruby on Rails version you use. This means all security issues found in the future will not be fixed for your app version. You can check your Ruby on Rails version support here.

Even if your version receives Security Updates you still need to perform an upgrade. Although, it is a much easier process.

Cloud providers’ tech stacks deprecation warnings are another reason to upgrade as soon as possible. To enforce you stay secure and use supportable software, some cloud providers like Heroku deprecate outdated tech stacks and ask you to upgrade.

If none of that is applicable to you, consider the following known wisdom.

Regular upgrades cause regular, but small pain for the development team. Rare upgrades cause rare, but big pain.

Last, but not least. Old versions of Ruby on Rails can make your development team less productive. Framework developers spent years improving it and making it more and more efficient. It is a good idea to benefit from their efforts.

Technical risks #

As you decide to upgrade, pay attention to the following issues, which are considered to be the most common.

  • Incompatible libraries.
  • Deprecation of existing code.
  • Change in existing code behavior.
  • New infrastructure is required (Ruby, Postgres, Server, etc.).
  • 3rd-party integrations stop working.

Business risks #

  • Data loss. Major upgrades require database structure changes. This could lead to unexpected data loss.
    Solution: backup all the data before an update
  • Broken functionality. A major upgrade requires every existing feature to be tested.
    Solution: write Unit Tests and perform regression testing
  • Live site downtime.
    Solution: warn users and prepare a rollback plan.

Upgrading #

Here is an example flow of the common Ruby on Rails upgrade.

No
Yes
It is not necessary to upgrade to the final version in one go
No
Yes
Determine your current stack and versions
Get familiar with the code
Launch the copy of the working app on your dev machine
Check the test coverage. Is it enough?
Write the minimal valuable amount of Unit tests
Choose the target upgrade version
Read upgrade notes for the next Ruby on Rails version
Upgrade infrastructure if required: Ruby, Database, OS
Change the Ruby on Rails version in Gemfile and run bundle update
Find all the libraries involved in the update
Fix all incompatible libraries
Fix all deprecated/changed code issues
Make sure all Unit tests are passing
Is the final target version reached?
Go to deploy

Go Live #

Ready to go live? How to make it safely and without surprises? We suggest following the next approximate plan.

Usually when users are the least affected by possible downtime
Create testing environment
Deploy your app to the testing environment
Make sure all functions are working properly with regression testing
Backup all the production live app data
Warn your users about upcoming update
Plan the right time for the update
Plan the disaster recovery and rollback strategy
Perform the production update

Read further about Upgrading Ruby on Rails apps in our Case studies.

We are ready to provide expert's help with your product
or build a new one from scratch for you!

Contact MobiDev’s tech experts!
We uses cookies to provide necessary site functionality and improve your experience. By browsing our website, you consent to our use of cookies.