2014年5月9日金曜日

Redmine 2.5.1へアップグレード

以前こちらで、アップグレードしたRedmine2.3系を2.5.1へアップグレード

ちなみに環境はCentOS6.4+PostgreSQL9.2+Apache+Passenger

●DBバックアップ
# /usr/local/pgsql/bin/pg_dump -U [dbuser] -Fc [dbname] > /home/redmine/public_html/db_`date +%Y%m%d`.dump

●旧Redmineのバックアップと新ディレクトリの作成
# mv /home/redmine/public_html /home/redmine/public_html_v232

# mkdir /home/redmine/public_html
# chmod 775 /home/redmine/public_html

●Redmineダウンロード
# cd /usr/local/src
# wget http://www.redmine.org/releases/redmine-2.5.1.tar.gz
# tar zxvf redmine-2.5.1.tar.gz
# mv ./redmine-2.5.1/* /home/redmine/public_html/

●設定ファイル等を移動
# cd /home/redmine/public_html_232/
# cp ./config/database.yml /home/redmine/public_html/config/
# cp ./config/configuration.yml /home/redmine/public_html/config/
# cp ./config/additional_environment.rb /home/redmine/public_html/config/
# cp -rf ./files/* /home/redmine/public_html/files/

テーマのfarend_fancyは最新にするため不要
# cp -r ./public/themes/farend_fancy /home/redmine/public_html/public/themes/

プラグインを使用していないため不要
# cp -r ./plugins/* /home/redmine/public_html/plugins/

●テーマ(farend_fancy)を最新へ
# cd /usr/local/src
# wget https://github.com/farend/redmine_theme_farend_fancy/archive/master.tar.gz
# tar zxvf master
# mv ./redmine_theme_farend_fancy-master/ ./farend_fancy
# cp -r ./farend_fancy /home/redmine/public_html/public/themes/

●PostreSQL用アダプタの追加インストール(ver.0.17.1)
# cd /home/redmine/public_html
# gem install pg -v '0.17.1' -- --with-pg-config=/usr/local/pgsql/bin/pg_config --no-rdoc --no-ri
Fetching: pg-0.17.1.gem (100%)
Building native extensions.  This could take a while...
Successfully installed pg-0.17.1
1 gem installed
Installing ri documentation for pg-0.17.1...
Installing RDoc documentation for pg-0.17.1...

●Gemfileに従い依存ソフトのインストール
# cd /home/redmine/public_html

mysql不要でオプション指定しているが何故かMySQL用アダプターで怒られる・・・
database.ymlファイル内のproduction:項目以外はコメントにしてみたらOKだった

# bundle install --without development test mysql sqlite
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
Using rake (10.1.1)
Using i18n (0.6.9)
Using multi_json (1.10.0)
Using activesupport (3.2.17)
Using builder (3.0.0)
Using activemodel (3.2.17)
Using erubis (2.7.0)
Using journey (1.0.4)
Using rack (1.4.5)
Using rack-cache (1.2)
Using rack-test (0.6.2)
Using hike (1.2.3)
Using tilt (1.4.1)
Using sprockets (2.2.2)
Using actionpack (3.2.17)
Using mime-types (1.25.1)
Using polyglot (0.3.4)
Using treetop (1.4.15)
Using mail (2.5.4)
Using actionmailer (3.2.17)
Using arel (3.0.3)
Using tzinfo (0.3.39)
Using activerecord (3.2.17)
Using activeresource (3.2.17)
Using awesome_nested_set (2.1.6)
Using bundler (1.2.3)
Using coderay (1.1.0)
Using rack-ssl (1.3.4)
Using json (1.8.1)
Using rdoc (3.12.2)
Using thor (0.19.1)
Using railties (3.2.17)
Using jquery-rails (2.0.3)
Using net-ldap (0.3.1)
Using pg (0.17.1)
Installing ruby-openid (2.3.0)
Installing rack-openid (1.4.2)
Installing rails (3.2.17)
Installing redcarpet (2.3.0) with native extensions
Using rmagick (2.13.2)
Your bundle is updated! Use `bundle show [gemname]` to see where a bundled gem is installed.

●仕上げ
# rake generate_secret_token
# rake db:migrate RAILS_ENV=production
==  CreateQueriesRoles: migrating =============================================
-- create_table(:queries_roles, {:id=>false})
   -> 0.0874s
-- add_index(:queries_roles, [:query_id, :role_id], {:unique=>true, :name=>:queries_roles_ids})
   -> 0.0161s
==  CreateQueriesRoles: migrated (0.1036s) ====================================

==  AddQueriesVisibility: migrating ===========================================
-- add_column(:queries, :visibility, :integer, {:default=>0})
   -> 0.0473s
-- remove_column(:queries, :is_public)
   -> 0.0009s
==  AddQueriesVisibility: migrated (0.0941s) ==================================

==  CreateCustomFieldsRoles: migrating ========================================
-- create_table(:custom_fields_roles, {:id=>false})
   -> 0.0008s
-- add_index(:custom_fields_roles, [:custom_field_id, :role_id], {:unique=>true, :name=>:custom_fields_roles_ids})
   -> 0.0030s
==  CreateCustomFieldsRoles: migrated (0.0177s) ===============================

==  AddQueriesOptions: migrating ==============================================
-- add_column(:queries, :options, :text)
   -> 0.0005s
==  AddQueriesOptions: migrated (0.0005s) =====================================

==  AddUsersMustChangePasswd: migrating =======================================
-- add_column(:users, :must_change_passwd, :boolean, {:default=>false, :null=>false})
   -> 0.0121s
==  AddUsersMustChangePasswd: migrated (0.0122s) ==============================

==  RemoveEolsFromAttachmentsFilename: migrating ==============================
==  RemoveEolsFromAttachmentsFilename: migrated (0.1646s) =====================

==  SupportForMultipleCommitKeywords: migrating ===============================
==  SupportForMultipleCommitKeywords: migrated (0.0543s) ======================

==  AddRepositoriesCreatedOn: migrating =======================================
-- add_column(:repositories, :created_on, :timestamp)
   -> 0.0008s
==  AddRepositoriesCreatedOn: migrated (0.0008s) ==============================

==  AddCustomFieldsFormatStore: migrating =====================================
-- add_column(:custom_fields, :format_store, :text)
   -> 0.0011s
==  AddCustomFieldsFormatStore: migrated (0.0012s) ============================

==  AddCustomFieldsDescription: migrating =====================================
-- add_column(:custom_fields, :description, :text)
   -> 0.0006s
==  AddCustomFieldsDescription: migrated (0.0007s) ============================

==  RemoveCustomFieldsMinMaxLengthDefaultValues: migrating ====================
-- change_column(:custom_fields, :min_length, :int, {:default=>nil, :null=>true})
   -> 0.0108s
-- change_column(:custom_fields, :max_length, :int, {:default=>nil, :null=>true})
   -> 0.0016s
==  RemoveCustomFieldsMinMaxLengthDefaultValues: migrated (0.0142s) ===========

==  StoreRelationTypeInJournalDetails: migrating ==============================
==  StoreRelationTypeInJournalDetails: migrated (0.0124s) =====================

==  DeleteOrphanTimeEntriesCustomValues: migrating ============================
==  DeleteOrphanTimeEntriesCustomValues: migrated (0.0314s) ===================

==  ChangeChangesetsCommentsLimit: migrating ==================================
==  ChangeChangesetsCommentsLimit: migrated (0.0000s) =========================

# rake redmine:plugins:migrate RAILS_ENV=production
# rake tmp:cache:clear
# rake tmp:sessions:clear
# chown -R daemon:daemon /home/redmine/public_html





おしまい

Google検索