RedmineUpgrade » History » Version 83
Go MAEDA, 2022-12-24 08:23
RMagick was replaced by MiniMagick in Redmine 4.1. MiniMagick can be installed without ImageMagick. So, usually `--without-minimagick` is not necessary
1 | 1 | Jean-Philippe Lang | h1. Upgrading |
---|---|---|---|
2 | |||
3 | 70 | Jean-Philippe Lang | The documentation below is based on upgrading to Redmine 2.x and higher. You can view a previous version for upgrading to Redmine 1.x "here":/projects/redmine/wiki/RedmineUpgrade?version=53. |
4 | 56 | Etienne Massip | |
5 | 15 | Eric Davis | {{>toc}} |
6 | 1 | Jean-Philippe Lang | |
7 | 15 | Eric Davis | h2. Step 1 - Check requirements |
8 | 1 | Jean-Philippe Lang | |
9 | 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. |
10 | |||
11 | h2. Step 2 - Backup |
||
12 | |||
13 | 77 | Toshi MARUYAMA | 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. |
14 | 15 | Eric Davis | |
15 | 81 | Go MAEDA | To understand how to back up your Redmine, please read [[RedmineBackupAndRestore|Backing up and restoring Redmine]]. |
16 | 15 | Eric Davis | |
17 | h2. Step 3 - Perform the upgrade |
||
18 | |||
19 | 1 | Jean-Philippe Lang | Now it's time to perform the actual upgrade. This process is different depending on how you downloaded Redmine. You only need to perform *one* of the following options. |
20 | |||
21 | 70 | Jean-Philippe Lang | h3. Option 1 - Download a stable release |
22 | 15 | Eric Davis | |
23 | 70 | Jean-Philippe Lang | 1. [[Download]] the release in either tar.gz or zip format and uncompress the new program archive in a new directory. |
24 | 15 | Eric Davis | |
25 | 72 | Toshi MARUYAMA | Make sure the newly extracted and copied files and directories have the correct owner and group set, so that the user/group running your application server can actually access the files. |
26 | 74 | Go MAEDA | Also, remember to add write permissions to the @files@, @log@ and @tmp@ directory. |
27 | 72 | Toshi MARUYAMA | |
28 | 51 | Jean-Philippe Lang | 2. Copy your database settings-file @config/database.yml@ into the new @config@ directory. If you're running Redmine >= 1.4 with mysql and ruby1.9, change the database adapter to `mysql2`. |
29 | 15 | Eric Davis | |
30 | 48 | Etienne Massip | 3a. Copy your base configuration settings-file @config/configuration.yml@ into the new @config@ directory. |
31 | |||
32 | 1 | Jean-Philippe Lang | 3b. Or, *if upgrading from version older than 1.2.0*, copy your email settings from your @config/email.yml@ into the new @config/configuration.yml@ file that can be created by copying the available @configuration.yml.example@ file. |
33 | 15 | Eric Davis | |
34 | 67 | Jean-Philippe Lang | 4. Copy the @files@ directory content into your new installation (this directory contains all your uploaded files). |
35 | 15 | Eric Davis | |
36 | 70 | Jean-Philippe Lang | 5. Copy the folders of your *custom* plugins from your @plugins@ directory (or @vendor/plugins@ directory if upgrading from a 1.x version) into new installation @plugins@ directory. Make sure that you copy only plugins that are were not initially bundled with your previous Redmine setup. |
37 | 1 | Jean-Philippe Lang | |
38 | 68 | Toshi MARUYAMA | 6. Install the required gems by running: |
39 | 1 | Jean-Philippe Lang | |
40 | 68 | Toshi MARUYAMA | bundle install --without development test |
41 | |||
42 | 70 | Jean-Philippe Lang | Only the gems that are needed by the adapters you've specified in your database configuration file are actually installed (eg. if your config/database.yml uses the 'mysql2' adapter, then only the mysql2 gem will be installed). Don't forget to re-run `bundle install` when you change config/database.yml for using other database adapters. |
43 | 68 | Toshi MARUYAMA | |
44 | 70 | Jean-Philippe Lang | If you need to load some gems that are not required by Redmine core (eg. fcgi), you can create a file named Gemfile.local at the root of your redmine directory. It will be loaded automatically when running `bundle install`. |
45 | 68 | Toshi MARUYAMA | |
46 | 1 | Jean-Philippe Lang | 7. Run the following command from your new Redmine root directory: |
47 | 68 | Toshi MARUYAMA | |
48 | 75 | Toshi MARUYAMA | If you're upgrading from Redmine 2.x or below, remove the following file if it exists: |
49 | * config/initializers/secret_token.rb |
||
50 | 1 | Jean-Philippe Lang | |
51 | 75 | Toshi MARUYAMA | Then generate a new secret by running the following command under the application directory: |
52 | |||
53 | bundle exec rake generate_secret_token |
||
54 | |||
55 | Alternatively, you can store this secret in config/secrets.yml: |
||
56 | http://guides.rubyonrails.org/upgrading_ruby_on_rails.html#config-secrets-yml |
||
57 | 1 | Jean-Philippe Lang | |
58 | 22 | Brad Langhorst | 8. Check for any themes that you may have installed in the @public/themes@ directory. You can copy them over but checking for updated version is ideal. |
59 | 68 | Toshi MARUYAMA | |
60 | 26 | salt racer | VERY IMPORTANT: do NOT overwrite @config/settings.yml@ with the old one. |
61 | 1 | Jean-Philippe Lang | |
62 | 65 | Jean-Philippe Lang | h3. Option 2 - Upgrading from a SVN checkout |
63 | 1 | Jean-Philippe Lang | |
64 | 1. Go to the Redmine root directory and run the following command: |
||
65 | <pre> |
||
66 | svn update |
||
67 | 69 | Toshi MARUYAMA | </pre> |
68 | |||
69 | 70 | Jean-Philippe Lang | 2. Install the required gems by running the following command: |
70 | 15 | Eric Davis | |
71 | bundle update |
||
72 | |||
73 | 1 | Jean-Philippe Lang | h2. Step 4 - Update the database |
74 | 28 | rafael mascayano | |
75 | 1 | Jean-Philippe Lang | This step is the one that could change the contents of your database. Go to your new redmine directory, then migrate your database: |
76 | |||
77 | 78 | Toshi MARUYAMA | <pre> |
78 | bundle exec rake db:migrate RAILS_ENV=production |
||
79 | </pre> |
||
80 | |||
81 | 1 | Jean-Philippe Lang | If you have installed any plugins, you should also run their database migrations: |
82 | 78 | Toshi MARUYAMA | |
83 | <pre> |
||
84 | bundle exec rake redmine:plugins:migrate RAILS_ENV=production |
||
85 | </pre> |
||
86 | 1 | Jean-Philippe Lang | |
87 | 15 | Eric Davis | h2. Step 5 - Clean up |
88 | 1 | Jean-Philippe Lang | |
89 | 82 | Go MAEDA | 1. Clear the cache: |
90 | 10 | Azamat Hackimov | |
91 | 82 | Go MAEDA | bundle exec rake tmp:cache:clear RAILS_ENV=production |
92 | 71 | Jean-Philippe Lang | |
93 | 62 | Etienne Massip | 2. Restart the application server (e.g. puma, thin, passenger) |
94 | 12 | Mischa The Evil | |
95 | 15 | Eric Davis | 3. Finally go to _"Admin -> Roles & permissions"_ to check/set permissions for the new features, if any. |
96 | 1 | Jean-Philippe Lang | |
97 | 15 | Eric Davis | h2. Common issues |
98 | 10 | Azamat Hackimov | |
99 | 30 | Zach Gardner | h3. Errors with repository management |
100 | 33 | Cyber Sprocket | |
101 | 1 | Jean-Philippe Lang | There were several new features added to the reposman.rb file, make sure you have a group specified if you're having issues ( --group=groupnamehere). Also, make sure you follow the instructions [[Repositories_access_control_with_apache_mod_dav_svn_and_mod_perl|here]] again if you only copied your Redmine.pm, and update your Apache configuration as the recommended configuration has changed. |
102 | 33 | Cyber Sprocket | |
103 | h3. Generating a new @secret_token.rb@ |
||
104 | |||
105 | 34 | Cyber Sprocket | Before version:2.0.0, a @session_store.rb@ file needed to be generated in Redmine's @config@ directory for the cookie based sessions to work. |
106 | 33 | Cyber Sprocket | |
107 | 32 | Szymon Połom | Starting from version:2.0.0, the @session_store.rb@ file should not exist. Instead, the following command will generate the @secret_token.rb@ file: |
108 | 35 | Cyber Sprocket | |
109 | 71 | Jean-Philippe Lang | bundle exec rake generate_secret_token |
110 | 32 | Szymon Połom | |
111 | _Note: The code repository for Redmine does not contain the config/initializers/secret_token.rb file, it is created by the above rake command._ |
||
112 | 35 | Cyber Sprocket | |
113 | h3. Related Resources |
||
114 | |||
115 | These resources may help you with your Redmine upgrade: |
||
116 | |||
117 | 66 | Jean-Philippe Lang | * Error while browsing the wiki history after upgrading from Redmine 1.x with SQLite: see #12501 |
118 | 45 | Jean-Philippe Lang | * "mod_fcgid for Apache2":http://httpd.apache.org/mod_fcgid/ helped us get Rails running on Apache 2 |
119 | 35 | Cyber Sprocket | * "Running Redmine on Apache":http://www.redmine.org/wiki/redmine/HowTo_configure_Apache_to_run_Redmine |
120 | 76 | Mischa The Evil | * "Notes about our 0.8.6 to 0.9.3 upgrade issues and how to resolve them":http://web.archive.org/web/20111214022108/http://www.cybersprocket.com/2010/project-management/upgrading-redmine-from-8-6-to-9-3/ --cybersprocket (2010-04-25) |
121 | * "Notes about our 0.9.6 to 1.0(RC) upgrade process":http://web.archive.org/web/20120610010521/http://www.cybersprocket.com/2010/tips-tricks/upgrading-redmine-from-0-9-6-to-1-0-0/ --cybersprocket (2010-08-14) |