Layers for developers

Rails upgrades: one minor at a time, in 5 steps

The Rails upgrade guide recommends moving slowly, one minor version at a time, to make good use of deprecation warnings. It starts with tests: good coverage is the best way to be sure the app still works.

The loop

1. Write tests and make sure they pass.
2. Move to the latest patch of your current version.
3. Fix tests and deprecated features.
4. Move to the latest patch of the next minor.
5. Repeat until you reach the target.

For each move, change the version in the Gemfile and update Rails, then run bin/rails app:update and your tests.

Example

Illustrative. From 7.2 to 8.1 you go through 8.0: that's 2 moves. Give each one a week, plus a week for test coverage first. About 3 weeks for one app.

Important

The update task works in an interactive session and helps create new files and change old ones. Read each change before you accept it.

Before step 1

  • ☐ Check test coverage
  • ☐ Note your current patch version
  • ☐ List the minors on your path
  • ☐ Book time per move

Gantt chart — one task per minor version →

Source: guides.rubyonrails.org, Upgrading Ruby on Rails.

Source