2012年7月30日 星期一

Redmine v1.4.x 升級到 Redmine v2.0.x 的升級步驟


Redmine v1.4.x 升級到 Redmine v2.0.x 的升級步驟:

基本更新步驟:

  1. 切換到安裝目錄:
    cd /home/apps
  2. 備份舊有的資料:
    mv redmine redmine_bak
  3. 取得最新的程式:
    /usr/local/bin/svn co http://redmine.rubyforge.org/svn/branches/2.0-stable redmine
  4. 複製資料庫設定、上傳檔案、Theme:
    cp /home/apps/redmine_bak/config/database.yml /home/apps/redmine/config/
    cp -ai /home/apps/redmine_bak/files/* /home/apps/redmine/files/
    cp -ai /home/apps/redmine_bak/public/themes/* /home/apps/redmine/public/themes/
  5. Plugins:先不要安裝與更新,等下面步驟完成後再來處理。
  6. 切換到 redmine 根目錄中:
    cd redmine
  7. 更新 RubyGem:
    gem update --system
  8. 檢查並更新 gems:
    bundle install --without development test postgresql
  9. Generate a session store secret:
    rake generate_secret_token
  10. 更新 Database Schema:
    rake db:migrate RAILS_ENV=production
  11. 更新 Plugins 的 Database Schema:
    rake redmine:plugins:migrate RAILS_ENV=production
  12. 清除 cache:
    rake tmp:cache:clear
    rake tmp:sessions:clear
  13. 啟動 WEBrick web server 來進行測試:
    ruby script/rails server webrick -e production

更新 Plugins:

  • Redmine V2.0.x 的 Plugins 目錄從 Redmine V1.x 的 /vendor/plugins 移到 /plugins。
  • 建議的更新方式是一個一個慢慢來,更新完成再進行下一個。
  • 更新流程:(安裝一個 plugin 後,執行 3-5 步驟,確認沒有錯誤後,再安裝下一個 plugin)
    1. 切換到 redmine 根目錄中:
      cd redmine
    2. 檢查並更新 gems (非必要,除非有提醒再執行):
      bundle install --without development test postgresql
    3. 安裝一個 Plugin:
    4. 更新 Database Schema:
      rake db:migrate RAILS_ENV=production
    5. 更新 Plugins 的 Database Schema:
      rake redmine:plugins:migrate RAILS_ENV=production
    6. 啟動 WEBrick web server 來進行測試:
      ruby script/rails server webrick -e production