RedmineUpgrade » History » Version 16
Eric Davis, 2009-04-02 22:28
Make the downloaded and svn upgrade to be different options.
1 | 1 | Jean-Philippe Lang | h1. Upgrading |
---|---|---|---|
2 | |||
3 | 15 | Eric Davis | {{>toc}} |
4 | 1 | Jean-Philippe Lang | |
5 | 15 | Eric Davis | h2. Step 1 - Check requirements |
6 | 1 | Jean-Philippe Lang | |
7 | 15 | Eric Davis | The first step to upgrading Redmine is to check that you meet the [[RedmineInstall#Requirements|requirements]] for the version you're about to install. |
8 | |||
9 | h2. Step 2 - Backup |
||
10 | |||
11 | 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. |
||
12 | |||
13 | h3. Backing up the files |
||
14 | |||
15 | 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. |
||
16 | |||
17 | h3. MySQL database |
||
18 | |||
19 | The @mysqldump@ command can be used to backup the contents of your MySQL database to a text file. |
||
20 | |||
21 | h3. SQLite database |
||
22 | |||
23 | SQLite databases are all contained in a single file, so you can back them up by copying the file to another location. |
||
24 | |||
25 | h3. PostgreSQL |
||
26 | |||
27 | The @pg_dump@ command can be used to backup the contents of a PostgreSQL database to a text file. |
||
28 | |||
29 | h2. Step 3 - Perform the upgrade |
||
30 | |||
31 | 16 | Eric Davis | Now it's time to perform the actual upgrade. This process if different depending on how you downloaded Redmine. You only need to perform *one* of the following options. |
32 | 15 | Eric Davis | |
33 | 16 | Eric Davis | h3. Option 1 - Downloaded release (tar.gz or zip file) |
34 | 15 | Eric Davis | |
35 | 1. Uncompress the new program archive in a new directory. |
||
36 | |||
37 | 2. Copy your database settings-file @config/database.yml@ into the new @config@ directory. |
||
38 | |||
39 | 3. Copy the email settings-file @config/email.yml.example@ to @config/email.yml@ and edit this file to adjust your SMTP settings. |
||
40 | |||
41 | 4. Copy the @RAILS_ROOT/files@ directory content into your new installation. |
||
42 | |||
43 | 16 | Eric Davis | h3. Option 2 - Upgrading from a SVN [[CheckingoutRedmine|checkout]] |
44 | 15 | Eric Davis | |
45 | 2 | Jean-Philippe Lang | 1. Go to the Redmine root directory and run the following command: |
46 | 1 | Jean-Philippe Lang | <pre> |
47 | svn update |
||
48 | </pre> |
||
49 | |||
50 | 15 | Eric Davis | 2. If you are upgrading the trunk version of Redmine to r2493 or above, you must generate a secret for cookie store. See the note at the bottom about generating a @session_store@. |
51 | |||
52 | h2. Step 4 - Update the database |
||
53 | |||
54 | This step is the one that could change the contents of your database. Go to your new redmine directory, then migrate your database: |
||
55 | |||
56 | 1 | Jean-Philippe Lang | <pre> |
57 | rake db:migrate RAILS_ENV="production" |
||
58 | </pre> |
||
59 | |||
60 | 15 | Eric Davis | If you have installed any plugins, you should also run their database migrations. |
61 | 1 | Jean-Philippe Lang | <pre> |
62 | 15 | Eric Davis | rake db:migrate_plugins RAILS_ENV="production" |
63 | 1 | Jean-Philippe Lang | </pre> |
64 | |||
65 | 15 | Eric Davis | h2. Step 5 - Clean up |
66 | 1 | Jean-Philippe Lang | |
67 | 15 | Eric Davis | 1. You should clear the cache and the existing sessions: |
68 | 1 | Jean-Philippe Lang | <pre> |
69 | rake tmp:cache:clear |
||
70 | 10 | Azamat Hackimov | rake tmp:sessions:clear |
71 | 3 | Jean-Philippe Lang | </pre> |
72 | 12 | Mischa The Evil | |
73 | 15 | Eric Davis | 2. Restart the application server (e.g. mongrel, thin, passenger) |
74 | 12 | Mischa The Evil | |
75 | 15 | Eric Davis | 3. Finally go to _"Admin -> Roles & permissions"_ to check/set permissions for the new features, if any. |
76 | 1 | Jean-Philippe Lang | |
77 | 15 | Eric Davis | h2. Common issues |
78 | 10 | Azamat Hackimov | |
79 | 15 | Eric Davis | h3. Generating a session_store.rb |
80 | 1 | Jean-Philippe Lang | |
81 | 15 | Eric Davis | An unique @session_store.rb@ file needs to be generated for Redmine for the new cookie based sessions to work. This is required on the trunk version of Redmine at r2493 or above. Just run the following command and Redmine will create one for you: |
82 | 10 | Azamat Hackimov | <pre> |
83 | rake config/initializers/session_store.rb |
||
84 | </pre> |
||
85 | |||
86 | 15 | Eric Davis | |
87 | h3. Errors about a missing session_store.rb |
||
88 | |||
89 | If you see any errors about a missing @session_store.rb@ file, run the command above to create a new one. |
||
90 | |||
91 | h3. Error about the Rails version |
||
92 | |||
93 | Also remember that the trunk version of Redmine after r2493 uses Rails 2.2.2, so you will need to upgrade your Ruby on Rails gem: |
||
94 | 1 | Jean-Philippe Lang | <pre> |
95 | gem install rails -v=2.2.2 |
||
96 | </pre> |
||
97 | |||
98 | 15 | Eric Davis | As part of the Rails 2.2.2 upgrade, plugin migrations will need to be updated as well |
99 | <pre> |
||
100 | rake db:migrate:upgrade_plugin_migrations RAILS_ENV="production" |
||
101 | </pre> |