4. Performing the Upgrade

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:
  • Rakefile
  • config/environment.rb
  • config/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 .

Make a backup, run the rails command, and reapply any customizations you made:

$ cd /path/to/myapp
$ cd ..
$ cp -r myapp myapp_backup
$ rails myapp
Say 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

If your 0.13.1 application is version-controlled, preserving your customizations is easier. For example, with Subversion you can perform the upgrade against a clean working copy then use svn diff to see exactly what changed:
$ cd /path/to/my/apps/svn/checkout
$ svn commit -m "Before Rails 1.0" 
$ rails .
$ svn diff
With 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"

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.