4. Performing the Upgrade
4.1 Getting Started
Make a backup or use version control. Upgrading is simple, but simple mistakes hurt.
Several crucial files in your application have changed between 0.13.1 and 1.0. If you’ve customized any of these, you’ll need to merge your changes back in after upgrading:Rakefileconfig/environment.rbconfig/environments/*scripts/*
For a quick look at how the upgrade will affect your app, run the rails command on your application directory with the --pretend option:
$ cd /path/to/my/app $ rails --pretend .
4.2 Without Version Control
Make a backup, run the rails command, and reapply any customizations you made:
$ cd /path/to/myapp $ cd .. $ cp -r myapp myapp_backup $ rails myappSay yes to overwrite any modified files. When the upgrade is complete, look through the affected files and manually merge in the customizations you made from
myapp_backup.
You can use a diff tool to examine the differences between myapp and myapp_backup. On Windows, use a graphical diff/merge tool. On Mac, Linux, *BSD, and others:
$ diff -Naur myapp_backup myapp
You’re done when your tests pass:
$ rake test
4.3 With Subversion
svn diff to see exactly what changed:
$ cd /path/to/my/apps/svn/checkout $ svn commit -m "Before Rails 1.0" $ rails . $ svn diffWith the diff output as a guide, merge your customizations back in to. You’re done when your app’s tests pass:
$ rake test [...] $ svn commit -m "Woohoo, upgraded to Rails 1.0"
4.4 That's All, Folks
Congratulations, you’ve upgraded your app to Rails 1.0!
Read the release notes to start working with Migrations, SwitchTower, plugins, and more.
If you’re having trouble upgrading your application, we can help! Post to the Rails mailing list or ask in the Rails IRC channel.