| Thank you for replying to give more context. You have some courage to go to a Ruby project and try to upgrade Rails from 4 to 7. I hope it will go as smoothly as possible. Props to you! I am not sure if it helps and maybe you know these, but just in case here are 3 URLs I keep at hand when I upgrade Rails: 1. https://railsdiff.org (where it shows diff from sources) 2. https://www.fastruby.io/blog/tags/upgrades (they have some great articles in cases of some upgrades) 3. https://guides.rubyonrails.org/v6.1/upgrading_ruby_on_rails.... (there is page for each version just replace v6.1 with the major version that you need) And also if you have not already started may I suggest you don't go directly from Rails 4 to Rails 7 but just try to go to each major(ish) version: Rails 4.0 -> 4.1.x
Rails 4.1 -> 5.0.x
Rails 5.0 -> 5.1.x
Rails 5.1 -> 5.2.x
Rails 5.2 -> 6.0.x
Rails 6.0 -> 6.1.6.1
Rails 6.1 -> 7.0.x
For each version there is an upgrade page. Eg:- https://guides.rubyonrails.org/v4.1/upgrading_ruby_on_rails.... - https://guides.rubyonrails.org/v5.0/upgrading_ruby_on_rails.... - https://guides.rubyonrails.org/v5.1/upgrading_ruby_on_rails.... You might want to give a try to this gem: https://github.com/fastruby/next_rails. I did not used it so far but I would have a Rails 4 app I will probably try to use it. |
It was less courage and more desperation, as the project was running on a server which died before Christmas and we needed it back up before January. The last major change to the project was ~6 years ago and nobody had touched it in ~5 years, so there was nobody around who had the slightest idea how it worked. Props to Rails for just working for that long with practically zero maintenance. In case you're wondering why we had critical software running on a single server with no maintenance: student organization.
We weren't able to find/install an Ruby installation old enough to run the project, so we decided to just upgrade. It was the brute force approach of "run the project, see what error pops up, google the error, fix the error, repeat". In hindsight, this wasn't a good idea and I could probably have found the right Ruby version with a bit more digging, but it works at least.
It's just a handful of pages with minimal code though, so now that things are less desperate I'm considering just starting from scratch with a clean Rails install and manually recreating them. Just need to deal with the legacy database schema and make some changes to it.