# App upgrade steps from 1.2.4 to 2.0.2?

**URL:** <https://www.ruby-forum.com/t/app-upgrade-steps-from-1-2-4-to-2-0-2/128112>\
**Category:** Rails\
**Created:** [February 5, 2008, 6:11am UTC](https://www.ruby-forum.com/t/app-upgrade-steps-from-1-2-4-to-2-0-2/128112 "2008-02-05T06:11:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rheoled](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ac91a4/32.png) [@Rheoled](https://www.ruby-forum.com/u/Rheoled)\
**Post date:** [February 5, 2008, 6:11am UTC](https://www.ruby-forum.com/t/app-upgrade-steps-from-1-2-4-to-2-0-2/128112/1 "2008-02-05T06:11:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Rheoled](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ac91a4/32.png) [@Rheoled](https://www.ruby-forum.com/u/Rheoled)\
**Post date:** [February 5, 2008, 6:38am UTC](https://www.ruby-forum.com/t/app-upgrade-steps-from-1-2-4-to-2-0-2/128112/2 "2008-02-05T06:38:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Rheoled](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ac91a4/32.png) [@Rheoled](https://www.ruby-forum.com/u/Rheoled)\
**Post date:** [February 5, 2008, 7:41am UTC](https://www.ruby-forum.com/t/app-upgrade-steps-from-1-2-4-to-2-0-2/128112/3 "2008-02-05T07:41:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Rheoled](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ac91a4/32.png) [@Rheoled](https://www.ruby-forum.com/u/Rheoled)\
**Post date:** [February 5, 2008, 5:37pm UTC](https://www.ruby-forum.com/t/app-upgrade-steps-from-1-2-4-to-2-0-2/128112/4 "2008-02-05T17:37:24Z")

</div>

> 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:

> **[Ruby on Rails](https://rubyonrails.org)**
>
> A web-app framework that includes everything needed to create database-backed web applications according to the Model-View-Controller (MVC) pattern.

> 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

---

<div class="post-metadata">

**Author:** ![Rheoled](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ac91a4/32.png) [@Rheoled](https://www.ruby-forum.com/u/Rheoled)\
**Post date:** [February 13, 2008, 12:04am UTC](https://www.ruby-forum.com/t/app-upgrade-steps-from-1-2-4-to-2-0-2/128112/5 "2008-02-13T00:04:23Z")

</div>

On Feb 5, 8:58 am, Aaron [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > 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.

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

---

<div class="post-metadata">

**Author:** ![Rheoled](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ac91a4/32.png) [@Rheoled](https://www.ruby-forum.com/u/Rheoled)\
**Post date:** [February 13, 2008, 12:05am UTC](https://www.ruby-forum.com/t/app-upgrade-steps-from-1-2-4-to-2-0-2/128112/6 "2008-02-13T00:05:35Z")

</div>

One other error generated into schema.rb:

# Could not dump table “virtual\_host” because of following

StandardError

# Unknown type ‘inet’ for column ‘vip’
