Upgrading¶
- Upgrading
- Step 1 - Backup
- MySQL database
- SQLite database
- PostgreSQL
- Step 2 - Perform the upgrade
- Option 1 - Downloaded release (tar.bz2)
- Option 2 - Upgrading from git
- Option 3 - Upgrading from a package (RPM, DEB)
- Step 4 - Update the database
- Step 5 - Clean up
- Common issues
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)¶
- Uncompress the new program archive in a new directory.
- Copy your database settings-file
config/database.ymlinto the newconfigdirectory.
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¶
1. Go to the Foreman root directory and run the following command:
git pull
git submodule init
git submodule update
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
