Migrating to MySQL in Instiki
[[!include contents]]] :category: help So you've been running Instiki, for a while, with the default [SQLite](http://www.sqlite.org/) database engine. Now you've decided to migrate to a beefier alternative, like [MySQL](http://mysql.com/). Here's how to migrate your data (based on an article by [Al Hoang](http://blogs.law.harvard.edu/hoanga/2007/02/07/migrating-instiki-from-one-database-type-to-another/)). 1. Set an environment variable in your shell. * Under `sh` and its cousins (`bash`, `zsh`, etc) type % RAILS_ENV='production' * Under `csh` and its cousins (`tcsh`, etc) type % setenv RAILS_ENV production 2. Export your database to `dump/fixtures/*.yml` % rake db:fixtures:export_all 3. Edit `config/database.yml`, replacing production: adapter: sqlite3 database: db/production.db.sqlite3 with something along the lines of <pre><code>production:<br /> adapter: mysql<br /> database: <i style="color:red">your_db_name</i><br /> username: <i style="color:red">your_db_username</i><br /> password: <i style="color:red">your_db_password</i><br /> host: 127.0.0.1<br /> port: 3306</code></pre> (The precise details will depend on your setup.) 4. Create a database in MySQL, with the same name as the one you gave in `database.yml`, using something like <pre><code>% echo "create database <i style="color:red">your_db_name</i>" | mysql -u <i style="color:red">your_db_username</i> -p <i style="color:red">your_db_password</i></code></pre> 5. Initialize the database tables and reimport your data % rake migrate % rake db:fixtures:import_all
AltStyle
によって変換されたページ
(->オリジナル)
/
アドレス:
モード:
デフォルト
音声ブラウザ
ルビ付き
配色反転
文字拡大
モバイル