Redmineのバージョンアップ

 alminiumで入れたRedmineのバージョンが2.3.1で、最新のバージョンが2.3.2に上がっていたので入れ替えた。この手順ですべてにおいて正しいのかはちょっと不明。一応動いてはいるっぽい。
 MySQLのバックアップとかもして置いた方が良いだろうが、同一サーバ内での入れ替えかつマイナーバージョンの違いだけなら平気だろうということで省略した。

手順

Apache/Redmineの停止
# service https stop
ダウンロードしたredmineの展開
# tar zxf redmine-2.3.2.tar.gz
既存のディレクトリをリネーム
# mv /opt/alminium/ /opt/alminium.bak
新しいredmineをコピー。ディレクトリ名もalminiumにしておく。
# cp -Rap redmine-2.3.2 /opt/alminium
旧バージョンから新バージョンへのファイルのコピー
# cd /opt/
# cp -Rap alminium.bak/files/* alminium/files/
# cp -Rap alminium.bak/log/* alminium/log/
# cp -Rap alminium.bak/plugins/* alminium/plugins/
# cp -Rap alminium.bak/config/*.yml alminium/config/
# cp -Rap alminium.bak/public/themes/gitmike/ alminium/public/themes/
# cp -Rap alminium.bak/public/themes/railsgun/ alminium/public/themes/
パーミッションの変更
# chown apache:apache -R .
マイグレーションの実行。

ディレクトリの移動

# cd /opt/alminium

ここでいろいろエラーが出た。

# rake db:migrate RAILS_ENV="production"
You cannot specify the same gem twice with different version requirements.
You specified: nokogiri (< 1.6.0) and nokogiri (>= 0)      

"plugins/redmine_backlogs/"ディレクトリの削除

# rm -rf  plugins/redmine_backlogs/ 

再度マイグレーション実行

# rake db:migrate RAILS_ENV="production"
Could not find gem 'rails (= 3.2.13) ruby' in the gems available on this machine.
Run `bundle install` to install missing gems.
bundle installを実行
# bundle install
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using rake (10.1.0)
Installing i18n (0.6.1)
Installing multi_json (1.7.7)
Installing activesupport (3.2.13)
Installing builder (3.0.0)
Installing activemodel (3.2.13)
Installing erubis (2.7.0)
Installing journey (1.0.4)
Installing rack (1.4.5)
Installing rack-cache (1.2)
Installing rack-test (0.6.2)
Installing hike (1.2.3)
Installing tilt (1.4.1)
Installing sprockets (2.2.2)
Installing actionpack (3.2.13)
Installing mime-types (1.23)
Installing polyglot (0.3.3)
Installing treetop (1.4.14)
Installing mail (2.5.4)
Installing actionmailer (3.2.13)
Installing arel (3.0.2)
Installing tzinfo (0.3.37)
Installing activerecord (3.2.13)
Installing activeresource (3.2.13)
Using bundler (1.3.5)
Installing nokogiri (1.5.10)
Installing ffi (1.9.0)
Installing childprocess (0.3.9)
Installing rubyzip (0.9.9)
Installing websocket (1.0.7)
Installing selenium-webdriver (2.33.0)
Installing xpath (1.0.0)
Installing capybara (2.0.3)
Installing coderay (1.0.9)
Installing diff-lcs (1.1.3)
Installing gherkin (2.12.0)
Installing multi_test (0.0.2)
Installing cucumber (1.3.5)
Installing rack-ssl (1.3.3)
Installing json (1.8.0)
Installing rdoc (3.12.2)
Installing thor (0.18.1)
Installing railties (3.2.13)
Installing rails (3.2.13)
Installing cucumber-rails (1.3.1)
Installing database_cleaner (1.1.1)
Installing jquery-rails (2.0.3)
Installing metaclass (0.0.1)
Installing mocha (0.13.3)
Installing mysql2 (0.3.13)
Installing net-ldap (0.3.1)
Installing ruby-openid (2.1.8)
Installing rack-openid (1.3.1)
Installing redcarpet (3.0.0)
Installing rmagick (2.13.2)
Installing rspec-core (2.11.1)
Installing rspec-expectations (2.11.3)
Installing rspec-mocks (2.11.3)
Installing rspec (2.11.0)
Installing rspec-rails (2.11.4)
Installing shoulda-context (1.0.2)
Installing shoulda-matchers (1.4.1)
Installing shoulda (3.3.2)
Installing sqlite3 (1.3.7)
Installing yard (0.8.7)
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
Post-install message from rdoc:
Depending on your version of ruby, you may need to install ruby rdoc/ri data:

<= 1.8.6 : unsupported
 = 1.8.7 : gem install rdoc-data; rdoc-data --install
 = 1.9.1 : gem install rdoc-data; rdoc-data --install
>= 1.9.2 : nothing to do! Yay!
再度マグレーションを実行
# rake db:migrate RAILS_ENV="production"
プラグインのマグレーションを実行

"db:migrate:upgrade_plugin_migrations"の方は実行するとエラーになったので、結局無視した。

# rake db:migrate:upgrade_plugin_migrations RAILS_ENV=production
rake aborted!
Don't know how to build task 'db:migrate:upgrade_plugin_migrations'

(See full trace by running task with --trace)

"db:migrate_plugins"はdeprecatedなようなので、"redmine:plugins:migrate"を使った方が良いかも。

# rake db:migrate_plugins RAILS_ENV=production
Migrating clipboard_image_paste (Clipboard image paste)...
Migrating redmine_banner (Redmine Banner plugin)...
Migrating redmine_charts (Redmine Charts)...
Migrating redmine_code_review (Redmine Code Review plugin)...
Migrating redmine_drafts (Redmine Drafts plugin)...
Migrating redmine_git_branch_hook (Redmine Git Branch Hook plugin)...
Migrating redmine_hudson (Redmine Hudson plugin)...
Migrating redmine_importer (Issue Importer)...
Migrating redmine_local_avatars (Redmine Local Avatars plugin)...
Migrating redmine_plugin_views_revisions (Redmine plugin views revisions plugin)...
Migrating redmine_redcarpet_formatter (Redcarpet Markdown Wiki formatter)...
Migrating redmine_scm (SCM Creator)...
Migrating redmine_spent_time_column (Redmine Spent Time Column)...
Migrating redmine_xls_export (Issues XLS export)...

Note: The rake task db:migrate_plugins has been deprecated, please use the replacement version redmine:plugins:migrate
秘密鍵の作成
# rake generate_secret_token
Apache/Redmineの起動
# service httpd start