Project

General

Profile

RedmineUpgrade » History » Revision 15

Revision 14 (Eric Davis, 2009-02-26 19:29) → Revision 15/84 (Eric Davis, 2009-04-02 22:25)

h1. Upgrading 

 {{>toc}} 

 h2. Step 1 - Check requirements 

 The first step to upgrading Redmine is to Before upgrading, check that you meet the [[RedmineInstall#Requirements|requirements]] for the version you're about to install. 

 h2. Step 2 - Backup 

 It is recommended that you backup your database and file uploads.    Most upgrades are safe but it never hurts to have a backup just in case. 

 h3. Backing up the files 

 All file uploads are stored to the @files/@ directory.    You can copy the contents of this directory to a another location to easily back it up. 

 h3. MySQL database 

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

 h3. SQLite database 

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

 h3. PostgreSQL 

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

 h2. Step 3 - Perform the upgrade 

 Now it's time to perform the actual upgrade.    This process if different depending on how you downloaded Redmine 

 h3. Downloaded release (tar.gz or zip file) 

 1. Uncompress the new program archive in a new directory. 

 2. Copy your database settings-file @config/database.yml@ into the new @config@ directory. 

 3. Copy the email settings-file @config/email.yml.example@ to @config/email.yml@ and edit this file to adjust your SMTP settings. 

 4. Copy the @RAILS_ROOT/files@ directory content into your new installation. 

 h3. Upgrading from a SVN [[CheckingoutRedmine|checkout]] 

 1. Go to the Redmine root directory and run the following command: 
 <pre> 
 svn update 
 </pre> 

 2. Migrate your database (please, make a database backup before doing this): 
 <pre> 
 rake db:migrate RAILS_ENV="production" 
 </pre> 

 3. If you are upgrading the from Redmine 0.8.x or trunk version of < r2493 to Redmine to r2493 or above, trunk => r2494, you must generate a secret for cookie store.    See the note at the bottom about generating a @session_store@. store: 
 <pre> 
 rake config/initializers/session_store.rb 
 </pre> 

 h2. Step 4 - Update the database 

 This step is the one Also remember that could change Redmine trunk => r2494 now uses Rails 2.2.2, don't forget to upgrade the contents of your database. Go to your new redmine directory, then migrate your database: 

 existing installation: 
 <pre> 
 rake db:migrate RAILS_ENV="production" gem install rails -v=2.2.2 
 </pre> 

 If you have installed any plugins, you should also run their database migrations. 
 Also as part of the Rails 2.2.2 upgrade, plugin migrations will need to be updated as well 

 <pre> 
 rake db:migrate_plugins db:migrate:upgrade_plugin_migrations RAILS_ENV="production" 
 </pre> 

 h2. Step 5 - Clean up 

 1. You should clear 4. Clear the cache and the existing sessions: 
 <pre> 
 rake tmp:cache:clear 
 rake tmp:sessions:clear 
 </pre> 

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

 3. Finally and go to _"Admin -> Roles & permissions"_ to check/set permissions for the new features, if any. 

 h2. Common issues Upgrading from a downloaded release 

 h3. Generating 1. Uncompress the new program archive in a session_store.rb new directory. 

 An unique @session_store.rb@ file needs to be generated for Redmine for 2. Copy your database settings-file @config/database.yml@ into the new cookie based sessions @config@ directory. 

 3. Copy the email settings-file @config/email.yml.example@ to work.    This is required on the trunk version of Redmine at r2493 or above.    Just run the following command @config/email.yml@ and Redmine will create one for you: edit this file to adjust your SMTP settings. 

 4. Go to your new redmine directory, then migrate your database (please, make a database backup before doing this): 
 <pre> 
 rake config/initializers/session_store.rb db:migrate RAILS_ENV="production" 
 </pre> 


 h3. Errors about a missing session_store.rb 

 5. If you see any errors about a missing @session_store.rb@ file, run the command above are upgrading from Redmine 0.8.x or trunk < r2493 to create Redmine trunk => r2494, you must generate a new one. secret for cookie store: 
 <pre> 
 rake config/initializers/session_store.rb 
 </pre> 

 h3. Error about the Rails version 

 Also remember that the Redmine trunk version of Redmine after r2493 => r2494 now uses Rails 2.2.2, so you will need don't forget to upgrade your Ruby on Rails gem: the existing installation: 
 <pre> 
 gem install rails -v=2.2.2 
 </pre> 

 As part of 6. Copy the Rails 2.2.2 upgrade, plugin migrations will need @RAILS_ROOT/files@ directory content into your new installation. 

 7. Restart the application and go to be updated as well 
 <pre> 
 rake db:migrate:upgrade_plugin_migrations RAILS_ENV="production" 
 </pre> _"Admin -> Roles & permissions"_ to check/set permissions for the new features, if any.