Hello. Need advice on migrating old app: ruby 1.9.3-p194, rails 3.2.11, OS Debian 7. I want to update this application, both from the system side, and from the side of the language and rails. Please suggest the order in which it would be more correct to do this.
There’s a Rails Guide for upgrading and it’s well worth a read and follow.
Step zero is to make sure you have good test coverage.
You’re going to face a three-way steel cage match here. The version of Ruby you’re using currently is way out of date, and hard to install these days on a modern OS version (ssl mismatches). You will need to do a stair-step upgrade of Rails, moving from 3.2.x to 4.0.x, then 4.1.x, then 4.2.x. Along the way, there are Ruby versions that you will have to move up as well, because some of the gems will stop working in 1.9 when you move them up to be compatible with higher Rails versions.
Avoid the temptation to do this all in one jump, because you will miss deprecation warnings. That’s why you don’t skip minor versions of Rails (which tend to be more like major versions). The hardest part of this will be figuring out which gem versions fit with which Rails versions with which Ruby versions. It’s an archeology project to be sure, and compounded by the number of third-party dependencies in your app.
There is another way to do this, of course, and that’s to rails new
a brand new app with a similar name, using the latest of everything. Then point the database connection at a copy of the old app’s DB, and copy over the models and their associated tests one by one. There is a strong risk that you will have to figure out a number of deprecations the hard way when you do this, but it can be less effort than the stepwise true upgrade.
Walter
PS: this is an excellent guide to the process as well: Rails: Upgrade process · railslink/resources Wiki · GitHub
Thanks for the answer, I also thought that the incremental update would be more difficult in my case.