Projet

Général

Profil

Redmine » Historique » Version 12

Mehdi Abaakouk, 23/06/2016 17:37

1 1 Laurent GUERBY
{{>toc}}
2 1 Laurent GUERBY
3 1 Laurent GUERBY
h1. Redmine
4 1 Laurent GUERBY
5 7 Mehdi Abaakouk
La machine chiliproject contient:
6 7 Mehdi Abaakouk
7 7 Mehdi Abaakouk
 - une base données postgres
8 7 Mehdi Abaakouk
 - une application installé dans /srv/http/redmine
9 7 Mehdi Abaakouk
 - le git de git.tetaneutral.net dans /srv/http/repositories
10 7 Mehdi Abaakouk
11 1 Laurent GUERBY
h2. Liens
12 1 Laurent GUERBY
13 1 Laurent GUERBY
* https://wiki.ldn-fai.net/wiki/Redmine#Par_mail ouvrir un ticket redmine par mail
14 10 Mehdi Abaakouk
* https://github.com/sileht/redmine-stupid-captcha - simple captcha pour tetaneutral.net
15 2 Mehdi Abaakouk
16 6 Mehdi Abaakouk
h2. Upgrade
17 6 Mehdi Abaakouk
18 12 Mehdi Abaakouk
Example d'upgrade de 3.1.X vers 3.3.X:
19 12 Mehdi Abaakouk
20 8 Mehdi Abaakouk
<pre>
21 6 Mehdi Abaakouk
# /etc/init.d/apache2 stop
22 1 Laurent GUERBY
# su - postgres
23 12 Mehdi Abaakouk
# pg_dump redmine > redmine-3.3.X-20160623.sql
24 6 Mehdi Abaakouk
# exit
25 6 Mehdi Abaakouk
#
26 11 Mehdi Abaakouk
# cd /srv/http/redmine
27 1 Laurent GUERBY
# git fetch --all
28 1 Laurent GUERBY
29 12 Mehdi Abaakouk
## For minor upgrade
30 12 Mehdi Abaakouk
# git pull --rebase origin/3.3-stable
31 1 Laurent GUERBY
32 12 Mehdi Abaakouk
## For major upgrade
33 12 Mehdi Abaakouk
# git checkout origin/3.4-stable -b ttnn/3.4
34 12 Mehdi Abaakouk
# git log origin/3.3-stable..ttnn/3.3 --pretty='%h - %s'
35 12 Mehdi Abaakouk
# git cherry-pick ... # pour chaque commit custom de ttnn listé précédement
36 12 Mehdi Abaakouk
37 12 Mehdi Abaakouk
# # Checkout plugins version compatible with redmine 3.X 
38 12 Mehdi Abaakouk
39 9 Mehdi Abaakouk
# cd plugins/redmine_git_hosting
40 12 Mehdi Abaakouk
# git fetch --all
41 12 Mehdi Abaakouk
# git checkout 1.2.1
42 1 Laurent GUERBY
# vi Gemfile
43 9 Mehdi Abaakouk
### comment redcap gem
44 9 Mehdi Abaakouk
# cd plugins/redmine_bootstrap_kit
45 12 Mehdi Abaakouk
# git fetch --all
46 12 Mehdi Abaakouk
# git checkout 0.2.4
47 6 Mehdi Abaakouk
# cd /srv/http/redmine
48 6 Mehdi Abaakouk
49 6 Mehdi Abaakouk
# tsocks bundle update
50 6 Mehdi Abaakouk
# gem cleanup
51 1 Laurent GUERBY
# tsocks bundle update
52 6 Mehdi Abaakouk
# bundle exec rake generate_secret_token
53 6 Mehdi Abaakouk
# bundle exec rake db:migrate RAILS_ENV=production
54 6 Mehdi Abaakouk
# bundle exec rake redmine:plugins:migrate RAILS_ENV=production
55 9 Mehdi Abaakouk
# bundle exec rake tmp:cache:clear tmp:sessions:clear RAILS_ENV=production
56 8 Mehdi Abaakouk
</pre>
57 2 Mehdi Abaakouk
58 2 Mehdi Abaakouk
h2. Investigation Erreur 500
59 2 Mehdi Abaakouk
60 5 Laurent GUERBY
http://lists.tetaneutral.net/pipermail/technique/2014-May/001335.html
61 5 Laurent GUERBY
62 2 Mehdi Abaakouk
Erreur dans /srv/http/redmine/log/production.log:
63 2 Mehdi Abaakouk
64 2 Mehdi Abaakouk
<pre>
65 2 Mehdi Abaakouk
Completed 500 Internal Server Error in 23.2ms
66 2 Mehdi Abaakouk
67 2 Mehdi Abaakouk
ActiveRecord::RecordNotUnique (PG::UniqueViolation: ERROR:  duplicate key value violates unique constraint "wiki_content_versions_pkey"
68 2 Mehdi Abaakouk
DETAIL:  Key (id)=(164) already exists.
69 2 Mehdi Abaakouk
: INSERT INTO "wiki_content_versions" ("author_id", "comments", "compression", "data", "page_id", "updated_on", "version", "wiki_content_id") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"):
70 2 Mehdi Abaakouk
</pre>
71 2 Mehdi Abaakouk
72 2 Mehdi Abaakouk
<pre>
73 2 Mehdi Abaakouk
# su - postgres
74 2 Mehdi Abaakouk
# psql redmine
75 3 Mehdi Abaakouk
# select max(id) from wiki_content_versions;
76 4 Mehdi Abaakouk
max  
77 4 Mehdi Abaakouk
------
78 4 Mehdi Abaakouk
 6193
79 4 Mehdi Abaakouk
(1 row)
80 3 Mehdi Abaakouk
# alter sequence wiki_content_versions_id_seq start 6194;
81 3 Mehdi Abaakouk
# alter sequence wiki_content_versions_id_seq restart;
82 2 Mehdi Abaakouk
</pre>