UpgradeRemineDebianSqueeze6 » History » Version 1
Maxim Volkov, 2014-05-13 09:04
1 | 1 | Maxim Volkov | h1. Upgrading Redmine 1.0.1 to 2.5.1 on Debian Squeeze (from repo to standalone mode) |
---|---|---|---|
2 | |||
3 | Debain Squeeze has Redmine 1.0.1 in it's repositories. If you want to install latest 2.x branch, you need to switch from package to standalone setup. Here is a step-by-step howto guide. |
||
4 | |||
5 | |||
6 | h2. Preparation |
||
7 | |||
8 | 1. Dump redmine_default database: |
||
9 | |||
10 | <pre> |
||
11 | mysqldump -u redmine -p redmine_default > /root/redmine/db.sql |
||
12 | </pre> |
||
13 | |||
14 | 2. Backup attachments folder: |
||
15 | |||
16 | <pre> |
||
17 | cp -R /var/lib/redmine/default/files /root/redmine/files |
||
18 | </pre> |
||
19 | |||
20 | 3. Delete redmine: |
||
21 | |||
22 | <pre> |
||
23 | apt-get remove redmine |
||
24 | </pre> |
||
25 | |||
26 | During uninstall choose to keep old database. |
||
27 | |||
28 | h2. Setup |
||
29 | |||
30 | 1. Required packages: |
||
31 | |||
32 | <pre> |
||
33 | apt-get install imagemagick libmagickcore-dev libmagickwand-dev libmysqlclient-dev |
||
34 | </pre> |
||
35 | |||
36 | 2. Download Redmine: |
||
37 | |||
38 | <pre> |
||
39 | rm -R /usr/share/redmine |
||
40 | cd /usr/share/redmine |
||
41 | wget http://www.redmine.org/releases/redmine-2.5.1.tar.gz |
||
42 | tar -xvf redmine-2.5.1.tar.gz |
||
43 | ln -s /usr/share/redmine-2.5.1 /usr/share/redmine |
||
44 | </pre> |
||
45 | |||
46 | 3. Install bundler: |
||
47 | |||
48 | <pre> |
||
49 | gem install bundler |
||
50 | </pre> |
||
51 | |||
52 | 4. Prepare environment: |
||
53 | |||
54 | <pre> |
||
55 | export PATH=$PATH:/var/lib/gems/1.8/bin |
||
56 | </pre> |
||
57 | |||
58 | _Without this you'll get "command not found" for bundle command._ |
||
59 | |||
60 | 5.Configure: |
||
61 | |||
62 | <pre> |
||
63 | cp /usr/share/redmine/config/configuration.yml.example /usr/share/redmine/config/configuration.yml |
||
64 | cp /etc/redmine/default/database.yml /usr/share/redmine/config/database.yml |
||
65 | </pre> |
||
66 | |||
67 | Edit /usr/share/redmine/config/database.yml and change adapter from mysql to mysql2. |
||
68 | |||
69 | Edit /usr/share/redmine/config/configuration.yml and setup the secret_token. Email config now is here also, so you can copy old settings from /etc/redmine/default/email.yml. |
||
70 | |||
71 | _You'll need to add this to smtp_settings group for this delivery method to work on Squeeze:_ |
||
72 | |||
73 | <pre> |
||
74 | enable_starttls_auto: false |
||
75 | </pre> |
||
76 | |||
77 | 6. Install: |
||
78 | |||
79 | <pre> |
||
80 | bundle install --without development test postgresql |
||
81 | </pre> |
||
82 | |||
83 | 7. Edit /usr/share/redmine/Gemfile, change rake version in it to: |
||
84 | |||
85 | <pre> |
||
86 | gem "rake", "0.8.7" |
||
87 | </pre> |
||
88 | |||
89 | _Without this rake will crash on startup. 0.8.7 is the latest compatible version._ |
||
90 | |||
91 | 8. Reconfigure rake: |
||
92 | |||
93 | <pre> |
||
94 | bundle update rake |
||
95 | </pre> |
||
96 | |||
97 | 9. Upgrade database and clean cache: |
||
98 | |||
99 | <pre> |
||
100 | rake generate_secret_token |
||
101 | rake db:migrate RAILS_ENV=production |
||
102 | </pre> |
||
103 | |||
104 | 10. Drop caches: |
||
105 | |||
106 | <pre> |
||
107 | rake tmp:cache:clear |
||
108 | rake tmp:sessions:clear |
||
109 | </pre> |
||
110 | |||
111 | 11. Bring back the attachments: |
||
112 | |||
113 | <pre> |
||
114 | cp -R /root/redmine/files/* /usr/share/redmine/files/ |
||
115 | </pre> |
||
116 | |||
117 | 12. Change directory owner: |
||
118 | |||
119 | <pre> |
||
120 | chown -R www-data /usr/share/redmine |
||
121 | </pre> |
||
122 | |||
123 | _Without this redmine will crash on /settings page._ |
||
124 | |||
125 | |||
126 | 13. Restart webserver and enjoy. |