以下はリビジョン865とFedora Core4を前提としている。
Ruby on Railsのインストール
を済ませておく。使用する予定のデータベース用ライブラリも含めてインストールしておく。
|% svn checkout svn://typosphere.org/typo/trunk typo
$ mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 6 to server version: 4.1.16 Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> CREATE DATABASE typo; Query OK, 1 row affected (0.42 sec) mysql> GRANT ALL PRIVILEGES ON typo.* TO username@localhost IDENTIFIED BY 'password-goes-here' WITH GRANT OPTION; Query OK, 0 rows affected (0.37 sec) % vi config/database.yml $ cat config/database.yml % mysql -u username -p typo < db/schema.mysql.sql
基本的に2.0.6->2.5.6へのアップグレードの解説 [(24)slash7]と同じ。
以下、2.6.0(stable)から865へアップグレードしたときのメモ。
$ mysqldump -u root -p typo > /tmp/typo-old.backup
注: 以下のエラーが出るときはrake 0.70以上が必要。
typo-new$ rake migrate
(in /somewhere/typo-new)
rake aborted!
undefined method `namespace' for main:Object
./Rakefile:10
typo-new$ cp /somewhere/typo-old/config/database.yml ./config typo-new$ rake migrate (in /somewhere/typo-new) Making your upload directory: /somewhere/typo-new/public/files Trying to add article_id to resources table ... done. Adding TextFilters table Converting Article and Page to use text_filter_id instead of text_filter Migrating all existing tables to InnoDB Adding GUIDs to Comments and Trackbacks Trying to add whiteboard to: articles... comments... pages... done. Renaming Articles table Copying article data Adding a type column Extending Content table Converting comments Extending Content table Converting trackbacks Extending content table Converting pages Updating all articles Adding podcast metadata fields Adding Redirect Table Setting published flag on each comment Adding comments_count, trackbacks_count Counting comments Boolifying contents.published Boolifying published Boolifying contents.allow_(comments|pings) Adding display name to tags
必要ならテーマをコピー。
typo$ cp -rp somewhereelse/typo/theme/yourthemedir ./theme
WEBrickあるいはfcgiの設定を変えるなどしてリスタート。
以下、例として865から876へアップデート。
typo$ svnversion . 865 typo$ svn info svn://typosphere.org/typo/trunk typo パス: trunk URL: svn://typosphere.org/typo/trunk リポジトリのルート: svn://typosphere.org/typo ... typo$ svn update U test/unit/article_test.rb U test/unit/ping_test.rb ... U . リビジョン 876 に更新しました。 typo$ svnversion . 876
adminでログインするとDatabase migrationの実行画面となり情報が表示されるので、問題無いようであれば”Update database now”ボタンをクリック。”You are update!”表示が出ればマイグレーション成功。失敗した場合は手動での修正が必要。