How to go about bringing a project up to date version-wise

I have a rather large project (44K lines of code, 800+GB of data, multiple 3rd-party gems) on Heroku that I need to move to newer Ruby/Rails versions due to sunsetting. The question is how best to accomplish this in the limited time available, while upgrading to the most recent version that makes sense). I’m not sure that I even know all the questions to ask, but here are some of them:

1) Is it best to make one big jump to the target version, or better to make incremental jumps to intermediate versions along the way? If the latter, how do I determine the appropriate intermediate versions to use?
2) The project was started with TDD, but TDD was abandoned as testing difficulties accumulated and deadlines loomed (e.g. how to fixturize lots of HTML data that was the basis for 50% of the processing, while data analysis comprised the other 50%). Obviously it would be easier to migrate with TDD, but is it worth the work to add it at this point?
3) I’m guessing there’s not an easy way to make the decision between using newer versions of current gems vs. selecting new gems that might be easier to integrate and/or better suited for our use, right?

Any advice offered on any facet of this project is welcome, as this is the first time that I’ve undertaken such a major upgrade. Also, references to documents covering this subject are also appreciated!

Basic app structure:
  1) Website with pages for signup, user configuration, and data chart generation.
  2) Sidekiq-driven background processing for lengthy and scheduled tasks (using Pro version for Reliable Queuing).

Current Ruby/Rails versions: MRI 2.0.0 / 3.2.21

Target versions: I’m targeting the Heroku-18 stack. What are the best target versions (looks like the minimum for Heroku Cedar-18 is MRI 2.5.7, but I don’t know what the minimum is for Rails)

Following gems are the major pieces that we depend on:
  PG (Postgres database, we use a lot of custom PG SQL)
  Sidekiq + Sidekiq Pro (2.13.1 / 1.2.2)
  Redis
  TheRubyRacer
  LogRage
  Stripe
  Mechanize & Nokogiri
  Roo and Spreadsheet
  RubyZip
  scbi_multi_gz_reader
  bcrypt-ruby
  will_paginate
  geoip
  retina-tag
  ZenDesk (+ JWT)
  UserAgent

Of course, if I can provide more information to help give accurate suggestions, don’t hesitate to ask.

Thanks!

Jack Royal-Gordon wrote:

1) Is it best to make one big jump to the target version, or better to
make incremental jumps to intermediate versions along the way? If the
latter, how do I determine the appropriate intermediate versions to use?

Current Ruby/Rails versions: MRI 2.0.0 / 3.2.21

Based on the Rails Upgrading Guide (linked and quoted below):

3.2.21 -> 3.2.22.5
-> 4.0.13 -> 4.1.16 -> 4.2.11.1
-> 5.0.7.2 -> 5.1.7 -> 5.2.4.1
-> 6.0.2.1

Rails 5 requires Ruby 2.2.2 or newer.
Rails 6 requires Ruby 2.5.0 or newer.

When changing Rails versions, it's best to move slowly, one minor version
at a time, in order to make good use of the deprecation warnings. Rails
version numbers are in the form Major.Minor.Patch. Major and Minor
versions are allowed to make changes to the public API, so this may cause
errors in your application. Patch versions only include bug fixes, and
don't change any public API.

The process should go as follows:

1. Write tests and make sure they pass.

2. Move to the latest patch version after your current version.

3. Fix tests and deprecated features.

4. Move to the latest patch version of the next minor version.

5. Repeat this process until you reach your target Rails version. Each
time you move versions, you will need to change the Rails version number
in the Gemfile (and possibly other gem versions) and run bundle update.
Then run the Update task mentioned below to update configuration files,
then run your tests.

LOL you can't "TDD" after the fact but you can certainly write tests
and believe me you'll have a much less bumpy upgrade experience
if you do :grinning:

···

On Thu, Mar 5, 2020 at 9:06 AM Jack Royal-Gordon <jackrg@pobox.com> wrote:

2) The project was started with TDD, but TDD was abandoned ... Obviously it would be easier to migrate with TDD, but is it worth the work to add it at this point?

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
twitter: @hassan
Consulting Availability : Silicon Valley or remote