Projet

Général

Profil

Redmine » Historique » Version 14

Version 13 (Mehdi Abaakouk, 23/06/2016 17:37) → Version 14/16 (Mehdi Abaakouk, 26/01/2017 07:58)

{{>toc}}

h1. Redmine

La machine chiliproject contient:

- une base données postgres
- une application installé dans /srv/http/redmine
- le git de git.tetaneutral.net dans /srv/http/repositories

h2. Liens

* https://wiki.ldn-fai.net/wiki/Redmine#Par_mail ouvrir un ticket redmine par mail
* https://github.com/sileht/redmine-stupid-captcha - simple captcha pour tetaneutral.net



h2. Upgrade

Example d'upgrade de 3.3.0 vers 3.3.2:
<pre>
# /etc/init.d/apache2 stop
# su - postgres
# pg_dump redmine > redmine-3.3.X-20170126.sql
# exit

# cd /srv/http/redmine
# git fetch --all
# git pull --rebase origin/3.3-stable

# cd plugins/redmine_git_hosting
# git stash # remets redcap dans les gems
# git fetch --all
# git tag | tail
1.2.0
1.2.1
1.2.2
# git checkout 1.2.2
# git stash pop # re-enleve redcap dans les gems

# cd ..plugins/redmine_bootstrap_kit
# git fetch --all
# git tag | tail
0.2.4
0.2.5
# git checkout 0.2.5

# cd ..plugins/redmine_startpage
# git pull --rebase # Ce project n'a que une branch master

# cd ..plugins/redmine_revision_diff
# git fetch --all
# git tag | tail
v0.1.1
v0.1.2
# git checkout v0.1.2

# cd /srv/http/redmine
# bundle update
# gem cleanup # ignorer les erreurs
# bundle update
# bundle exec rake db:migrate RAILS_ENV=production
# bundle exec rake redmine:plugins:migrate RAILS_ENV=production
# bundle exec rake tmp:cache:clear tmp:sessions:clear RAILS_ENV=production

</pre>

Example d'upgrade de
3.1.X vers 3.3.X:

<pre>
# /etc/init.d/apache2 stop
# su - postgres
# pg_dump redmine > redmine-3.1.X-20160623.sql
# exit
#
# cd /srv/http/redmine
# git fetch --all

## For minor upgrade
# git pull --rebase origin/3.1-stable

## For major upgrade
# git checkout origin/3.3-stable -b ttnn/3.3
# git log origin/3.1-stable..ttnn/3.1 --pretty='%h - %s'
# git cherry-pick ... # pour chaque commit custom de ttnn listé précédement

# # Checkout plugins version compatible with redmine 3.3.X

# cd plugins/redmine_git_hosting
# git fetch --all
# git checkout 1.2.1
# vi Gemfile
### comment redcap gem
# cd plugins/redmine_bootstrap_kit
# git fetch --all
# git checkout 0.2.4
# cd /srv/http/redmine

# tsocks bundle update
# gem cleanup # ignorer les erreurs
# tsocks bundle update
# bundle exec rake generate_secret_token
# bundle exec rake db:migrate RAILS_ENV=production
# bundle exec rake redmine:plugins:migrate RAILS_ENV=production
# bundle exec rake tmp:cache:clear tmp:sessions:clear RAILS_ENV=production
</pre>



h2. Investigation Erreur 500

http://lists.tetaneutral.net/pipermail/technique/2014-May/001335.html

Erreur dans /srv/http/redmine/log/production.log:

<pre>
Completed 500 Internal Server Error in 23.2ms

ActiveRecord::RecordNotUnique (PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "wiki_content_versions_pkey"
DETAIL: Key (id)=(164) already exists.
: 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"):
</pre>

<pre>
# su - postgres
# psql redmine
# select max(id) from wiki_content_versions;
max
------
6193
(1 row)
# alter sequence wiki_content_versions_id_seq start 6194;
# alter sequence wiki_content_versions_id_seq restart;
</pre>