Project

General

Profile

Upgrade instructions » History » Version 8

« Previous - Version 8/11 (diff) - Next » - Current version
Ohad Levy, 12/02/2011 03:47 AM


Upgrading

Step 1 - Backup

It is recommended that you backup your database and modifications to Foreman files(config/settings.yaml, unattended installations etc). Most upgrades are safe but it never hurts to have a backup just in case.

MySQL database

The mysqldump command can be used to backup the contents of your MySQL database to a text file.

SQLite database

SQLite databases are all contained in a single file, so you can back them up by copying the file to another location.

PostgreSQL

The pg_dump command can be used to backup the contents of a PostgreSQL database to a text file.

Step 2 - Perform the upgrade

Now it's time to perform the actual upgrade. This process if different depending on how you downloaded Foreman. You only need to perform one of the following options.

Option 1 - Downloaded release (tar.bz2)

  1. Uncompress the new program archive in a new directory.
  2. Copy your database settings-file config/database.yml into the new config directory.
    if your database is a simple file (e.g. SQLite), don't forget to make it available in the new directory.

VERY IMPORTANT: do NOT overwrite config/settings.yml with the old one.

Option 2 - Upgrading from git

Please note now that the development branch has moved to Rails 3, you MUST take care to select a branch and make sure you get the correct one.

1. Go to the Foreman root directory and run the following command:

For staying on the stable branch:


git checkout 0.4-stable
git pull
git submodule init
git submodule update

Or if you have to access github through a proxy using the HTTP urls

git checkout 0.4-stable
git pull
sed -i 's/git:\/\//http:\/\//g' .gitmodules
git submodule init
git submodule update

For upgrading to the Rails 3 based "develop" branch:


create a new directory
checkout a new copy of the code in the new directory using [[Installing_latest_code_]]
manually copy relevant config files

For upgrading within the Rails 3 develop branch:


git branch develop
git pull

Option 3 - Upgrading from a package (RPM, DEB)

Simply update your package via your normally, and you can skip Step 4

Step 4 - Update the database

This step is the one that could change the contents of your database. Go to your new Foreman directory (or the git dir), then migrate your database:

rake db:migrate RAILS_ENV="production" 

Step 5 - Clean up

1. You should clear the cache and the existing sessions:

rake tmp:cache:clear
rake tmp:sessions:clear

2. Restart the application server (e.g. mongrel, thin, passenger)

Common issues

see Troubleshooting