1

I'm working on a small project that has been allocated a small amount of time to maintain and update features. This project is on Rails 2.3.

I'd like to move it to Rails 3.2 but there is little time allocated to this so I would like to do it over a slow gradual process.

I'm thinking that it might be worth moving over to Rails 3.2 on a section-by-section basis. This would mean that I would create a second application that looks the same as the first one but is located somewhere different and accessed from a different subdomain.

Is this feasible if I just update the Rails 2.3 routes file for certain routes to go to the new application?

Has anyone done this before?

amaseuk
  • 2,147
  • 4
  • 24
  • 43
  • As far as I know you can't have a routes files that points to a Rails 2.3 and a 3.2 app... as the routes itself is part of the app (the routing engine is quite different between Rails 2 and 3). Maybe you could load both applications as rack endpoints one after the other, but if they are in different domains, then there's no need to mix routes, just make sure they are in the same general domain so you can share cookies to load an equivalent session in both of them). – Pablo Fernandez Mar 20 '12 at 15:03
  • At any rate you should get started getting rid of all warnings, upgrading all gems, getting rid of gems that are known to not be supported on Rails 3. That is probably going to be the bulk of your effort and you can do that while running Rails 2.3. – Pablo Fernandez Mar 20 '12 at 15:07
  • Thanks for your comment. I think it would be ok if the two applications were separate? With regards to sharing sessions across the applications, it shouldn't matter too much for this application as everything in the front end is public. – amaseuk Mar 20 '12 at 19:20

1 Answers1

1

It depends on many parameters but among these the most relevant are :

Does your Rails 2 project already use Bundler ? If not, migrate to it before the migration. Do you use gems which are known not to work on Rails 3 ? Does your project already use Rails XSS plugin (https://github.com/rails/rails_xss) ? If not, migrate to it before the migration.

After that, the migration will be easier.

For the migration, I recommend that you create a brand new Rails application using "rails new" command, so that all the boot files will be good. Then migrate the initializers/config files and "app" folder... Good luck.

Justin Tanner
  • 14,062
  • 17
  • 82
  • 103
Nicolas Blanco
  • 11,164
  • 7
  • 38
  • 49
  • Thanks - I'm going to migrate on a gradual basis - moving portions of views and controllers into the new app incrementally. – amaseuk Mar 20 '12 at 19:22