Moving MediaWiki


Follow the steps here:

Step 1. Back up the database[^1], [^2]

# sudo mysqldump -h localhost \
               -u wikiuser -p \
               --default-character-set=binary wikidb \
	| xz -9v \
	> MediaWiki-NotreDame-AnthonyFok_mysqldump_2015-12-29.sql.xz

See for the mysqldump command, and see$wgDBTableOptions for where I got the --default-character-set=binary from (my LocalSettings.php had it.)

Step 2. Back up the MediaWiki files

TODO… (I think I already lost them years ago, so…)

Step 3. Re-create the database, user and permissions


On Debian:

sudo apt-get install mediawiki

After installation, edit /etc/mediawiki/apache.conf and add

Alias /wiki /var/lib/mediawiki

Then, open http://localhost/wiki/ in the browser, and follow the link to set up the wiki at http://localhost/wiki/mw-config/index.php

After selecting the language, if you see this:


Object caching is not enabled.

Do this:

sudo apt-get install php5-apcu
sudo service apache2 reload

And the message is gone.

If you see this:

警告:intl PECL擴展無法處理Unicode正常化,故只能退而採用運行較慢的純PHP實現的方法。如果您運行着一個高流量的站點,請參閱Unicode正常化一文。

Do this:

sudo apt-get install php5-intl
sudo service apache2 reload

And you will get this:

使用intl PECL擴展實現Unicode正常化。


Before this, do:

But it is problematic! Using the instruction there, I got 'notredame'@'%' rather than 'notredame'@'localhost' created… :-p

MariaDB [(none)]> CREATE USER 'notredame'@'localhost' IDENTIFIED BY 'my_password';
MariaDB [(none)]> USE notredame_wiki
MariaDB [notredame_wiki]> GRANT SELECT, UPDATE, INSERT, DELETE, USAGE ON notredame_wiki.* TO 'notredame'@'localhost';
MariaDB [notredame_wiki]> SHOW GRANTS FOR 'notredame'@'localhost';
notredame_wiki (was my_wiki)

  • 存儲引擎:InnoDB
  • 資料庫字符集:二進制 (binary)