Search code examples
ruby-on-railsruby-on-rails-3ruby-on-rails-3.1migrationruby-on-rails-2

Migrating Rails 2.3.5 to Rails 3.x.x Steps With PitFalls and Traps


Update: The Question is Still Open, any reviews, comments are always welcome

As I already know lot QA's in stackoverflow regarding my topic, but most of them are closed and not properly answered.

Question 1) Steps for Migrating Rails 2.3.5 to Rails 3.x.x

Question 2) PitFalls and Traps

Question 3) Error Prone & Painfull Migration Phases

Note: I need Real Answers,Stuffs,Reviews and Suggestions are welcome, from those who involved in project migration from Rails 2.x.x to Rails 3.x.x


Solution

  • This has been answered in another question, How to update rails 2.3.10 to 3.x

    But here is what I learned from an attempt at upgrading. Have to try again since the first attempt failed.

    One of the most useful things I found in it was this plugin. https://github.com/rails/rails_upgrade/blob/master/README That would answer 1) with the steps for upgrading.

    Also, it is a lot easier to upgrade to 3.0 than to 3.1 or 3.2. 3.0 -> 3.1 breaks a lot of stuff. The suggestion is to do 2.3 -> 3.0 -> 3.1 -> ... all separately

    2) named scopes like they are used in 2.3 don't work with 3.x - they have to be replaced with the Rails 3 version of scopes. For me the most annyoing things are some gems which haven't been upgraded to use Rails 3, so I have to figure out a replacement or throw them out. Also Rails 3 insists on marking all the text I output from helpers and from every other place than views as unsafe, which is really annoying. I can't remember now what we did to fix that.

    3) Everything is very painful with upgrading Rails.

    Edit: I found this presentation today, seems very informative, http://www.slideshare.net/crnixon/rails-3-7983843