Project

General

Profile

UpgradeRemineDebianSqueeze6 » History » Version 3

Maxim Volkov, 2014-05-13 09:18

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 3 Maxim Volkov
_Without this bundler can't install all Redmine's requrements on Squeeze_
37
38 1 Maxim Volkov
2. Download Redmine:
39
40
<pre>
41
rm -R /usr/share/redmine
42 2 Maxim Volkov
cd /usr/share
43 1 Maxim Volkov
wget http://www.redmine.org/releases/redmine-2.5.1.tar.gz
44
tar -xvf redmine-2.5.1.tar.gz
45
ln -s /usr/share/redmine-2.5.1 /usr/share/redmine
46
</pre>
47
48
3. Install bundler:
49
50
<pre>
51
gem install bundler
52
</pre>
53
54
4. Prepare environment:
55
56
<pre>
57
export PATH=$PATH:/var/lib/gems/1.8/bin
58
</pre>
59
60
_Without this you'll get "command not found" for bundle command._
61
62
5.Configure:
63
64
<pre>
65
cp /usr/share/redmine/config/configuration.yml.example /usr/share/redmine/config/configuration.yml
66
cp /etc/redmine/default/database.yml /usr/share/redmine/config/database.yml
67
</pre>
68
69
Edit /usr/share/redmine/config/database.yml and change adapter from mysql to mysql2.
70
71 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. 
72 1 Maxim Volkov
73 2 Maxim Volkov
_You'll need to add @enable_starttls_auto: false@ to smtp_settings group for this delivery method to work on Squeeze:_
74 1 Maxim Volkov
75
6. Install:
76
77
<pre>
78 3 Maxim Volkov
bundle install --without development test
79 1 Maxim Volkov
</pre>
80
81
7. Edit /usr/share/redmine/Gemfile, change rake version in it to:
82
83
<pre>
84
gem "rake", "0.8.7"
85
</pre>
86
87
_Without this rake will crash on startup. 0.8.7 is the latest compatible version._
88
89
8. Reconfigure rake:
90
91
<pre>
92
bundle update rake
93
</pre>
94
95 2 Maxim Volkov
9. Upgrade database and drop caches:
96 1 Maxim Volkov
97
<pre>
98
rake generate_secret_token
99
rake db:migrate RAILS_ENV=production
100
rake tmp:cache:clear
101
rake tmp:sessions:clear
102
</pre> 
103
104 2 Maxim Volkov
10. Bring back the attachments:
105 1 Maxim Volkov
106
<pre>
107
cp -R /root/redmine/files/* /usr/share/redmine/files/
108
</pre>
109
110 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_
111 1 Maxim Volkov
112 2 Maxim Volkov
11. Change directory owner:
113
114 1 Maxim Volkov
<pre>
115
chown -R www-data /usr/share/redmine
116
</pre>
117
118 3 Maxim Volkov
_Without this redmine will crash on /settings page. Some people say it's enough to @chmod -R 777 /usr/share/redmine/tmp@, but it didn't work for me_
119 1 Maxim Volkov
120 2 Maxim Volkov
12. Restart webserver and enjoy.