Should I upgrade from rails 2.3 to 3+ or wait until rails 4 is released and upgrade then? [closed]
Asked Answered
S

2

10

I'm about to start working on porting a company's old rails ap from 2.3/1.87 to the most recent version of rails. Should I wait for rails 4, or should I just to 3.2?

We're going to take the opportunity to make sure there is full test coverage, and there will probably be some rewriting involved as well. The first goal is to make sure all current functionality is operational.

We want as much of the current codebase as-is to work under the most recent version of rails. We will rewrite any parts that don't.

Stairwell answered 30/1, 2013 at 20:45 Comment(0)
Q
18

I would consider the following two choices:

A) Re-write the app.
In this case I would do it in rails 3.2.10 Don't wait until 4 as it has to be released, shaken down, bugs found, etc. With rails it's almost never good to wait as it has such a rapid release cycle with major changes. Something I've learned the hard way over the last couple of years.

B) Upgrade it incrementally.
I would also not wait until 4 comes, go to 3.2.10 now. Start by updating the 2.3 app to rails 3.0 This will probably not actually be that hard. There are a few format changes and active record changes but most are fairly straight-forward and documented well by others. Take careful note of deprecation warnings as these are often introduced in rails versions x.0 and then actually removed in x.1 (so in this case that means 3.0 and 3.1)

Once this is complete and you've kicked the tires around and made sure everything works, then move on to upgrading to rails 3.1 This is actually a pretty big upgrade as it introduces the asset pipeline. You'll need to read up on that and follow the advice. Don't 'cop out' by not using it for production. Basically it does two key things: minifies js code and compiles all js and css code into 1 file (each). This help speeds up web pages and reduce server requests for all the individual assets.

Next upgrade ruby from 1.8.7 to 1.9.3 This should be relatively painless but as with all the steps check the app carefully and obviously if you have automated regression tests they should be run (same for each step outlined here).

Finally upgrade rails from 3.1 to 3.2.11 which includes a security fix.


Which choice you make will depends on a great number of other factors, both technical and non-technical, including:

  • developer bandwidth
  • developer experience
  • budget
  • timeline
  • quality of code
  • size of codebase
  • number of users of the apps (thus impact any isssues will have).
  • availablity of customer support to field calls about issues.

Useful Resources:

Quiroz answered 30/1, 2013 at 21:4 Comment(2)
I recently upgraded a 3.0/1.8.7/heroku-bamboo app to 3.2/1.9.2/heroku-cedar. It wasn't pretty. I did the recommended move to 3.1 first. It took 5 days. For this very old app, I'm going to start fresh with a new app, and port all controllers piece by piece. It's a good opportunity to go through the whole app and ensure test coverage, etc. I didn't write the original app. This makes the best sense to us for various reasons. So, that's not really going to change. The question is just whether I should do it in 3.2 or wait for 4.Stairwell
Ah yes, well given that information I strongly approve of the re-write. Great decision. Given that I would probably upgrade straight to 3.2.10 but I still would not wait until 4Quiroz
G
4

I think you need to update to 3.x at first, and after some time (when 4.1 or something like will be released) you will update your app to the latest Rails version.

I strongly recommend to create a huge work on making tests for the current codebase (if it is not done yet). When you get updated to Rails 3 you will get a good base of bugs which you need to fix before production.

And there are lot of tutorials (video and text) about how to update 2.x to 3.x Rails apps.

My recommendation: update your current app to 3.2 and wait until 4.x branch will come to stable and you can use it in production mode (it will take about 4-8 months from release of 4.0)

Gerry answered 30/1, 2013 at 20:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.