Project

General

Profile

UpgradeRemineDebianSqueeze6 » History » Version 4

Maxim Volkov, 2014-05-14 09:19

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 4 Maxim Volkov
We will remove the package, place new binaries at the same folder and upgrade database. There also some squeeze-specific workarounds.
6 1 Maxim Volkov
7
h2. Preparation
8
9
1. Dump redmine_default database:
10
11
<pre>
12
mysqldump -u redmine -p redmine_default > /root/redmine/db.sql
13
</pre>
14
15
2. Backup attachments folder:
16
17
<pre>
18
cp -R /var/lib/redmine/default/files /root/redmine/files
19
</pre>
20
21
3. Delete redmine:
22
23
<pre>
24
apt-get remove redmine
25
</pre>
26
27 4 Maxim Volkov
*During uninstall choose to keep old database.*
28 1 Maxim Volkov
29
h2. Setup
30
31
1. Required packages:
32
33
<pre>
34
apt-get install imagemagick libmagickcore-dev libmagickwand-dev libmysqlclient-dev
35
</pre>
36
37 4 Maxim Volkov
_Fix for: missing requirements for bundler_
38 3 Maxim Volkov
39 4 Maxim Volkov
2. Delete old Redmine, download new Redmine instead:
40 1 Maxim Volkov
41
<pre>
42
rm -R /usr/share/redmine
43 2 Maxim Volkov
cd /usr/share
44 1 Maxim Volkov
wget http://www.redmine.org/releases/redmine-2.5.1.tar.gz
45
tar -xvf redmine-2.5.1.tar.gz
46
ln -s /usr/share/redmine-2.5.1 /usr/share/redmine
47 4 Maxim Volkov
cd /usr/share/redmine
48 1 Maxim Volkov
</pre>
49
50
3. Install bundler:
51
52
<pre>
53
gem install bundler
54
</pre>
55
56
4. Prepare environment:
57
58
<pre>
59
export PATH=$PATH:/var/lib/gems/1.8/bin
60
</pre>
61
62 4 Maxim Volkov
_Fix for: "command not found" for bundle command_
63 1 Maxim Volkov
64
5.Configure:
65
66
<pre>
67
cp /usr/share/redmine/config/configuration.yml.example /usr/share/redmine/config/configuration.yml
68
cp /etc/redmine/default/database.yml /usr/share/redmine/config/database.yml
69
</pre>
70
71
Edit /usr/share/redmine/config/database.yml and change adapter from mysql to mysql2.
72
73 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. 
74 1 Maxim Volkov
75 4 Maxim Volkov
_You'll need to add @enable_starttls_auto: false@ to smtp_settings group for this delivery method to work on Squeeze_
76 1 Maxim Volkov
77
6. Install:
78
79
<pre>
80 3 Maxim Volkov
bundle install --without development test
81 1 Maxim Volkov
</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 4 Maxim Volkov
_Fix for: rake crash on start-up. 0.8.7 is the latest compatible version._
90 1 Maxim Volkov
91
8. Reconfigure rake:
92
93
<pre>
94
bundle update rake
95
</pre>
96
97 2 Maxim Volkov
9. Upgrade database and drop caches:
98 1 Maxim Volkov
99
<pre>
100
rake generate_secret_token
101
rake db:migrate RAILS_ENV=production
102
rake tmp:cache:clear
103
rake tmp:sessions:clear
104
</pre> 
105
106 2 Maxim Volkov
10. Bring back the attachments:
107 1 Maxim Volkov
108
<pre>
109
cp -R /root/redmine/files/* /usr/share/redmine/files/
110
</pre>
111
112
_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_
113
114
11. Change directory owner:
115 2 Maxim Volkov
116 1 Maxim Volkov
<pre>
117
chown -R www-data /usr/share/redmine
118
</pre>
119
120 4 Maxim Volkov
_Fix for: 500 error on administrative pages. Some people say it's enough to @chmod -R 777 /usr/share/redmine/tmp@, but it didn't work for me_
121 1 Maxim Volkov
122 4 Maxim Volkov
12. Restart web-server and enjoy.