0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

postgresでmediawiki

Last updated at Posted at 2019-10-27

はじめに

 今まで、sqliteでmediawikiを運用していたのだが、なんか遅くなってきて、postgresに変更したときのトラブル顛末。あまりpostgreのデータがないのでとりあえず。

2021/11/21の追記

 うまくいっていたつもりだが、1.30->1.35へのupgradeでトラブル中である。どうも、postgresのuserはmwuserというテーブルになっているので、maintenance/update.phpがきちんとpostgreをサポートしているのかが怪しい。まあこのトラブルを克服したのであれば、また新規ページを追加するが、その日が来るのかはあやしい。(と思ったがけっこうpostgreには関係ありませんでした)mediawikiのupgradeのトラブル解決

移行のパス

  • postgreで新規にmediawikiをインストールする

 - 旧のsqlite側で
php maintenance\dumpBackup.php backup.xml

  • 新のpostgre側で
    php maintenance\importDUmp.php < backup.xml
    ということで大丈夫でした。

経緯1

 sqliteのdumpでsqlを出力し、postgreにこのsqlを読み込もうとさせたのだが
まず、これがだめ。
 sqliteではautoincrementとかあるが、postgreはserialというデータにしないと
あかんとか、sqliteのblobをbyteaにするとかしてもあまりうまくいかない。

 pgloaderも試してみたが、うまく動かなかった

経緯2

そもそも、mediawikiにはuserというtableがあるのだが、これがpostgreでは予約語
であかん。そのために、localSettings.phpにはpostgre用に
$wgDBmwschemaというのがあって、スキーマでこれを設定したdatabaseを作成しておく
必要がある。


create database mywiki;
create schema mw;

とかにして、これをインストール時に設定するというのがpostgreを使うときのノウハウである。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?