Jump to content

Manual:Moving a wiki/ja

From mediawiki.org
This page is a translated version of the page Manual:Moving a wiki and the translation is 50% complete.
もしあなたがすぐにウィキを移動させるならこの解説を参照してください。

このページではウィキを他のサーバーへの移動のさせ方を説明しています。これは、別のウェブサーバーやドメイン(またはその両方)に移動する際に必要になることが多いです。

最も安全な方法は、両方のウィキで同じバージョンの MediaWiki を使用することです。 しかし、新しいサーバーにより新しいバージョンの MediaWiki をインストールして、その新しいサーバーで直接アップグレードを実行できます。 実際、これは、古いサーバーで利用できるものよりも高い要件 (php のバージョンなど) を持つ新しいバージョンにウィキをアップグレードしたい場合、唯一の選択肢かもしれません。

手順は基本的に他のページで説明しています:

  1. ご利用のウィキをバックアップします
  2. 古いサーバーから新しいサーバーにバックアップを転送します。
  3. 新しいサーバーでバックアップをリストアします
ウィキのバックアップを開始する前に、「読み取り専用」モードにして、移動中に誰も編集できないようにするといいでしょう。 そうしないと、移行作業中に行われた編集/アップロード/記録などが失われる場合があります。 そのためには、LocalSettings.php で $wgReadOnly を使用します。 例:
$wgReadOnly = 'Down for maintenance: access will be restored shortly';

サーバーのアップグレード

新しいサーバーで新しい MediaWiki バージョンにアップグレードする場合、古い MediaWiki ディレクトリと拡張機能を新しいサーバーにコピーする代わりに、アップグレード手順に従います。 新しいサーバーに新しい MediaWiki のバージョンをダウンロードし、新しい MediaWiki のバージョンに合わせて、使用する拡張機能の新しいバージョンをダウンロードします。 Remember to run the update script.

注記

  • If the URL has changed (for example, a new domain), be sure to update all references to it in LocalSettings.php. If using VisualEditor, you'll need to update Parsoid configuration too.
    • Links on cached pages may still point to the old domain. You may need to bump $wgCacheEpoch to discard cached pages prior to that time.
  • アップロードを使用している場合は、upload/ ディレクトリに正しいパーミッションが設定されていることを確認してください。ウェブサーバーが書き込み可能である必要があります。
  • Make sure any extension directories have the correct permissions as well (e.g., if linux: chmod -R o=rx extensions)
  • When manually transferring a wiki from a windows platform to a Linux platform the best method is to:
  1. Manually install MediaWiki on the Linux platform from a tar file as outlined here: Manual Install of Wiki (i.e., try not to use install from an automated package)
  2. Replace the newly installed MediaWiki folder (e.g., /var/www/mediawiki...) on your Linux machine with the MediaWiki base folder from your windows machine
  3. Linux マシンの MySQL データベース (例: wikidb) を、Windows マシンのウィキ データベースで更新します (つまり、上記で説明したように MySQL のバックアップと復元機能を使用します)。
  • After importing a wiki database, even if the database can work, some minor problems may arise:
  1. You might need to repair Searchindex: In phpMyAdmin, enter "REPAIR TABLE wikidb.searchindex; " for rebuilding the search index. wikidb is your database's name.
  2. The collation of some rows may be changed. Cross-check it with the original database.

テスト

この時点で、新しいサーバーでウィキを使用してみてください。 管理者および一般利用者としてログインし、ページの閲覧、作成、編集、ファイル アップロードが引き続き機能することを確認します。 PHP または MediaWiki 自体によって報告されたあらゆる問題点を修正します。

You can do the entire process to test if the move will work without problems, before actually putting the old wiki in read-only mode. 新しいサーバー上のウィキが期待通りに動作していることが確認できたら、旧ウィキを読み取り専用モードにして、再度移行を実行できます。

よくある問題点

Inaccessible files after changing the domain

module_deps テーブルの md_deps 列には絶対ファイルパスが含まれており、これらは CSS が依存する画像や LESS ファイルを特定するために使用されます。 These paths break when the wiki is, e.g., moved to another folder or another server. After your move, you might see PHP warnings that certain files could not be accessed. In current versions of MediaWiki, this can be solved by running update.php , thus clearing caches.

In versions older than MediaWiki 1.25 (where phabricator:T37472 is not implemented), update.php does not delete the contents of the module_deps table. For these versions, the workaround is to manually fix wrong entries in the module_deps table:

-- Update entries in module_deps table
SET @old='wiki.old-domain.org';
SET @new='wiki.new-domain.org';

UPDATE `module_deps` SET `md_deps` = REPLACE( `md_deps`, @old, @new );

This can be used to update wrong path segments and to fix the error.

A similar issue can happen when MediaWiki tries to read resource loader messages. In this case the solution is to truncate the according tables:

-- Truncate message related caches
TRUNCATE TABLE `msg_resource`;
TRUNCATE TABLE `msg_resource_links`;

関連項目

外部リンク