Project

General

Profile

UpgradeRemineDebianSqueeze6 » History » Version 2

Maxim Volkov, 2014-05-13 09:07

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 2 Maxim Volkov
cd /usr/share
41 1 Maxim Volkov
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 2 Maxim Volkov
Edit /usr/share/redmine/config/configuration.yml and setup the secret_token. Email config is also here now, so you can copy old settings from /etc/redmine/default/email.yml here by hand. 
70 1 Maxim Volkov
71 2 Maxim Volkov
_You'll need to add @enable_starttls_auto: false@ to smtp_settings group for this delivery method to work on Squeeze:_
72 1 Maxim Volkov
73
6. Install:
74
75
<pre>
76
bundle install --without development test postgresql
77
</pre>
78
79
7. Edit /usr/share/redmine/Gemfile, change rake version in it to:
80
81
<pre>
82
gem "rake", "0.8.7"
83
</pre>
84
85
_Without this rake will crash on startup. 0.8.7 is the latest compatible version._
86
87
8. Reconfigure rake:
88
89
<pre>
90
bundle update rake
91
</pre>
92
93 2 Maxim Volkov
9. Upgrade database and drop caches:
94 1 Maxim Volkov
95
<pre>
96
rake generate_secret_token
97
rake db:migrate RAILS_ENV=production
98
rake tmp:cache:clear
99
rake tmp:sessions:clear
100
</pre> 
101
102 2 Maxim Volkov
10. Bring back the attachments:
103 1 Maxim Volkov
104
<pre>
105
cp -R /root/redmine/files/* /usr/share/redmine/files/
106
</pre>
107
108 2 Maxim Volkov
_There are other ways to do this. For example, you can create a symlink from /usr/share/redmine/files to /var/lib/redmine/default/files and keep using previous location_
109 1 Maxim Volkov
110 2 Maxim Volkov
11. Change directory owner:
111
112 1 Maxim Volkov
<pre>
113
chown -R www-data /usr/share/redmine
114
</pre>
115
116
_Without this redmine will crash on /settings page._
117
118 2 Maxim Volkov
12. Restart webserver and enjoy.