App upgrade steps from 1.2.4 to 2.0.2?

Hi all, experienced programmer but complete RoR newbie here, this is
my first rails post/question so bear with me. I have a working RoR
app on 1.2.4 and PostgreSQL, and my first efforts at running it in
2.0.2 show it does not cleanly upgrade without changes. Can anyone
give me some hints/pointers as to what I'll need to change for 2.0.2
and how do I identify it other than trial and error?

Thanks!

Ed

Hopefully you have decent test coverage. I would strongly recommend
updating the app to Rails 1.2.6 first, running tests, and taking care
of all deprecated code. Then go up to 2.0.2. In 1.2.6 you get
warnings, in 2.0.2 the code is just gone which makes it much harder to
track down.

Other than that make sure you run "rake rails:update" every time you
change the Rails version and when you go to 2.0.2 watch out for the
default session store change. If your app uses the session
judiciously then you'll just need to set the session key secret in
environment.rb (there is a 2K size cap with the new default cookie
store). Also, some Rails functionality, like acts_as_list and
acts_as_tree, has been abstracted into plugins. If you are using any
of these you just need to install the plugins.

I found generating a new rails project and looking at how it
configures various files very helpful.

Aaron

Thanks for the tips, Aaron. A few more newbie questions...

How do I change the Rails version I'm using? I assume that is
different from the version of gems...

How do I identify deprecated code?

I've seen a few of the feature demonstrations of 2.0. Is there any
across-the-board compelling reason to run 2.0 over 1.2.6?

Last, has anyone written a tool yet to swallow up an existing schema
(preferably PostgreSQL) and generate a base for RoR migration code?
I'd like to use rails on some existing 100+ table DBs that do not
conform to the naming conventions.

Thanks!

Ed

How do I change the Rails version I'm using? I assume that is
different from the version of gems...

In the config/environment.rb file just change the version number in a
liine that looks like this:
RAILS_GEM_VERSION = '2.0.2' unless defined? RAILS_GEM_VERSION

How do I identify deprecated code?

That's where the tests come in. If you have good test coverage just
run the test and watch the deprecation messages that print to the
screen. If you don't have tests you could try running the app in
development mode and watching the server log as you use the
application. I'm pretty sure you'll see the deprecation messages
there too.

There's a rails deprecation list here, but don't consider it
comprehensive:
http://www.rubyonrails.org/deprecation

I've seen a few of the feature demonstrations of 2.0. Is there any
across-the-board compelling reason to run 2.0 over 1.2.6?

If the application is in active development then I would recommend
updating now so you can take advantage of the API improvements and get
into the "new" way of doing things. If the app is running along
nicely and you are not working on it right now then I would say there
is no rush. However, don't wait too long because making a large
version jump could be painful.

Last, has anyone written a tool yet to swallow up an existing schema
(preferably PostgreSQL) and generate a base for RoR migration code?
I'd like to use rails on some existing 100+ table DBs that do not
conform to the naming conventions.

Run "rake db:schema:dump" take the file that it creates and make it
migration #1.

Aaron

More newbie questions...

So, I ran "rake db:schema:dump", but the dump appears to have several
issues. First, there's this:

# Could not dump table "cluster" because of following StandardError
# Unknown type 'oid' for column 'maxoid'

Any hints on where I'd go to seek resolution on this one?

Second, I don't see any views, triggers, rules, or stored procedures
included in the dump output to schema.rb. Am I looking in the wrong
place?

Ed

One other error generated into schema.rb:

# Could not dump table "virtual_host" because of following
StandardError
# Unknown type 'inet' for column 'vip'