Manual:Upgrading/ja



ファイル転送
Unless you have direct access to the server hosting the wiki, (and even then) you will have to choose a method for transferring files:
 * Secure copy with SCP or WinSCP
 * SSH File Transfer Protocol (SFTP)
 * Using a FTP client.
 * The hosting company might provide a file manager interface via the web browser; check with your provider.
 * Some other method. There is a list of these at List of file transfer protocols

Preliminary
Read.


 * 1) 要件を確認する
 * 2) リリースノートを読む
 * 3) 既存のファイルとデータベースをバックアップする
 * 4) 新バージョンのファイルを展開（解凍）する
 * 5) 拡張機能（エクステンション）をアップグレードする
 * 6) 更新スクリプトを実行してデータベースをチェックする
 * 7) 更新を確認する

システム要件の確認
MediaWiki の要件は以下の通りです:


 * PHP 以降
 * MySQL 以降、PostgreSQL 8.3 以降、SQLite 3 のいずれか

PostgreSQL を使用している場合は、Postgres のアップグレードもお読みください.

詳細情報については、システム要件および互換性をお読みください.

リリースノートを読む
Within the distribution tarball, or within the files checked out/exported from Git, there are a number of files with capitalised filenames, one of which contains the  (ウィキ). Now's the time to open it up and find out what's been changed in this release.

既存のファイルとデータベースをバックアップする

 * 完全な説明書： Manual:Backing up a wiki/ja

アップグレードスクリプトがよく整備され堅牢であるとはいえ、things could still go awry. データベース構造を更新する前に、データベースとファイルの両方を含む、wikiの完全なバックアップを取得してください.


 * the wiki's content, from the database, (make sure you get the character set specified correctly, first check LocalSettings.php). It may be a good idea to create an XML dump in addition to the SQL database dump.
 * MySQL:
 * テキストダンプ: mysqldump --all-databases > file.txt
 * xmlダンプ: mysqldump --all-databases --xml > file.xml
 * PostgreSQL:
 * pg_restore の出力: pg_dump --create -Fc -i yourwiki > yourwiki.db.dump
 * SQLite:
 * php maintenance/sqlite.php --backup-to filename
 * 画像およびその他のメディアファイル（images ディレクトリの中身、カスタム ロゴ /skins/common/images/wiki.png）
 * 設定ファイル、例えば LocalSettings.php および AdminSettings.php （存在する場合）
 * MediaWikiのプログラムファイル. すべてのスキン・拡張機能を含む. 自分で変更した場合は特に.

tar 形式パッケージの使用
If you are using a tarball package, decompress the file on the server, preferably on a new and empty folder.

FTP またはグラフィカル
Windows users: use 7zip to extract the tarball.

FTP users: extract files locally and upload directories and files to server with your favorite FTP software.

コマンドライン
You may need to run the command as sudo if you don't have full write permissions to the wiki install directories under your current user. When untarring a tarball package normally a new directory for the new wiki version will be created and you will have to copy the old configuration files and images directory from your old installation directory:

$ tar xvzf mediawiki-.tar.gz -C /path/to/your/new/installation/

(Open)Solarisユーザは gtar を使うか、または:

$ gzip -dc mediawiki-.tar.gz | tar xf -

Once done, you should copy or move some files and folders from the old installation directory to the new one:
 * , which contains your old configuration settings.
 * the image file containing the logo, usually on upper left hand corner, as specified by Manual:$wgLogo which, by default is found in the  directory.
 * The  (or   in older versions) directory, which contains all the uploaded files to the wiki, unless you have chosen a different upload directory.

Other files and folders you might want to update from the old installation:
 * Some extensions in the  directory. You should always get updated extensions, old extensions aren't guaranteed to work with a newer version of MediaWiki.
 * Custom skins.
 * Any modifications made to the old installation files.
 * Any .htaccess file (if you're using Apache and you've defined any rule on it).

Once done, make this new folder the published folder on the web server, or rename the old installation directory and then rename the new one matching the old name.

Git の使用
If using Git, export the files into a clean location, and then copy the old customized files into the new location as described on the previous section.

パッチの使用
A small patch file is usually made available for a minor version upgrade. Manually download and extract the patch file from the dumps site or follow the directions with wget below.


 * 1) cd to your main MediaWiki directory (the one with LocalSettings.php).
 * 2) Download the patch file and gunzip it.
 * 3) Use   to check what will be changed (e.g.,   )
 * 4) If all is well, run patch again without.
 * 5) Check your Special:Version and you should see the new version number in place.

Files remaining that may cause errors
If you unpacked over the old installation directory, some old files can cause problems with the new version.

If you are not using profiling, but have a  file in the MediaWiki root folder, you may receive errors referring to. Deleting, or renaming, the  file will resolve this error. The  file, also in the MediaWiki root folder, can serve as a template should you enable profiling in the future.

拡張機能をアップグレード
拡張機能（エクステンション）の中には、新バージョンのMediaWikiで動作するよう更新されているものがあります. このような拡張機能については、必ず最新バージョンにアップグレードしてください. カスタム拡張機能については、手動で更新する必要があるかもしれません.

Different tarballs include some subsets of extensions and have versioning which helps you upgrade choosing the right one for your MediaWiki core release.

Extension Distributor works well for most people who want a snapshot of extensions that will work with their supported versions of MediaWiki.

If you want a lot of extensions then downloading from Git is probably best.

更新スクリプトを実行 
MediaWikiはコマンドラインとwebのどちらからでもアップグレードできます. サーバにシェルアクセスできるのであれば、タイムアウトや接続の切断によりアップグレード処理が中断する危険性を減らせるため、コマンドラインからのアップグレードを推奨します.

コマンドライン
Access the command line of your server or an SSH shell or similar. You can access the command line by connecting to your server via SSH. If the local PC you are working on runs Microsoft Windows, you will need a tool like PuTTY to use SSH. From the command line or the Shell, change to the maintenance</tt> directory and execute the update script:

$ php maintenance/update.php

On Linux if you get an error try performing same command as root (sudo php maintenance/update.php). Note for simple installations on Windows (e.g. with XAMPP): First make sure that your web server (such as Apache) and your database (such as MySQL) are running. Then run update.php: right-click it, select Open With, and browse to PHP.exe. The resulting command prompt window will likely autoclose when the schema upgrade completes.

You might see a message that your PHP version is too old and that MediaWiki needs a newer version. After that message the update aborts. Reason for this error is that the commandline can use another PHP version than that one which you have when you execute MediaWiki from the webserver. When you get this message you should check, if you can execute a newer PHP version on the shell by using a different command: That might e.g. be php5 or php53. If another version is available and - if so - under which name, depends on the setup of your server. If it does not work, ask your hoster; he will surely know.

MediaWikiは既存の構造を検査し、必要応じてテーブルやカラムを追加し、新しいコードで動作するよう構造を更新します.

「No superuser credentials」エラーの対処法
In case the scripts abort with a message: No superuser credentials could be found. Please provide the details of a user with appropriate permissions to update the database. See AdminSettings.sample for more details" This means that you should check that you have defined $wgDBadminuser and $wgDBadminpassword in your LocalSettings.php file (in the main directory). These are the user and password needed by this script in order to access to the database. (Note: Prior to MediaWiki 1.16, these variables were located in  . This file was removed in 1.16 and the variables were moved to LocalSettings.php.)

「unexpected T_STRING」エラーの対処法
Individuals running update.php from the command line may encounter the following error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' \ in ~/maintenance/commandLine.inc on line 13

This error occurs when update.php is run from php4.

Individuals who have their site hosted by providers who provide both php4 and php5 should take the following steps:
 * 1) from the command line, enter the command 'whereis php5'
 * 2) once you have discerned the location of the php5 path, list the contents of php5/bin directory
 * 3) once you've determined the name of the php executable (either php or php5), type in the entire path to execute update.php

Below is an example: $ whereis php5 $ ls -la /usr/local/php5/bin $ /usr/local/php5/bin/php update.php

What to do in case of 'register_argc_argv is set to false' error
You may encounter the error: Cannot get command line arguments, register_argc_argv is set to false

register_argc_argv=true
 * 1) Go to ~/maintenance. Either edit an existing 'php.ini' file, or create one.
 * 2) Add a line as follows:
 * 1) Re-run php update.php

Web アップデート

 * See also update.php

If your database is already big and in high production usage, then you should not be using the Web updater, e.g. because the update process will time out when the maximum_execution_time is reached. In that case you should use update.php from the command-line interface (not from the web). What exactly is "too big" depends on your server (e.g. on its performance, the load and on how long the maximum execution time of PHP allows the script to run). If your wiki is too big for the web updater and your hosting provider does not allow command-line access, then you need to migrate your wiki to another hosting account, preferably to one that does have shell access.


 * 1) Always backup before performing database maintenance.
 * 2) Navigate your webbrowser to /mw-config/</tt>. For example, if your wiki is at  http://example.org/w/index.php </tt>, then navigate to  http://example.org/w/mw-config/ </tt>.
 * 3) Select your language and click continue.
 * 4) The existing installation should be detected. Follow the instructions on the screen to upgrade it. If asked for the "upgrade key", open your LocalSettings.php file and look for the key assigned to $wgUpgradeKey.

It might happen that the web-updater does not seem to work: Instead of seeing the initial language selection screen, you might see an empty wiki page, possibly with some error message. In this case it is most likely that your webserver uses Rewrite Rules (most likely for short URLs), which do not show you the updater at mw-config/, but a wiki page at Mw-config/, with capital "M". In this case, rename the .htaccess file for the time of the update. Then you should be able to access the web-updater.

更新を確認する
アップグレードが完了したら、ブラウザでwikiを表示し、次の操作が期待どおりに動くか確認します.
 * ページの表示
 * ページの編集
 * ファイルのアップロード
 * Special:Versionを開き、バージョン表示が正しいことと拡張機能が存在することを確認します.

トラブルシューティング
If something is broken after upgrading, check the mediawiki-l mailing list and bugzilla.wikimedia.org to see if it is a known problem and whether there is a solution.

よくある質問と回答
<section begin=FAQ />

アップグレードはどのくらい大変ですか?
自分で修正を加えたファイルが LocalSettings.php のみであり、1.5以降からのアップグレードであれば、作業はとても単純です. 人手を伴なう作業量は数分だけです. データベース構造の変更には、データベースの大きさに比例した時間がかかります――何百万ものページがあるwikiでは数時間ですが、典型的な数千ページの大きさであれば普通は数秒で完了します.

同じメジャーバージョン内のマイナーアップグレード、例えば1.13.0から1.13.1へは、データベース構造の変更は全く必要ありません. ただファイルを更新するだけでいいのです. データベースの更新が要らないので、インストーラスクリプトを実行する必要はありません.

1.4以前からのアップグレードは複雑になる可能性があります. UTF-8以外のキャラクタセット（文字コードセット）のサポートが停止となり、テキストの大半を格納する構造が変わったためです. UPGRADE</tt> ファイルの関連セクションをお読みください.

MediaWiki のソースコードを修正していて、かつその変更を上書きされたくない場合、アップグレードが困難になります. diff、patch、Meld or WinMerge のようなツールが有用です. メンテナンスされていない拡張機能を使用している場合も、トラブルを引き起こすおそれがあります. MediaWiki のアップグレードと同時に、拡張機能もアップグレードしてください.

If you have modified the skin or use a custom skin you very likely will have to adjust it to work again with the new version of MediaWiki.
 * Tip: instead of patching your "global" css and js (javascript) files everytime you can simply add the code to your MediaWiki:Common.js and MediaWiki:Common.css pages. As these are part of the database which will be reused when you upgrade, you will not have to patch the MediaWiki core files any more.

とても古いバージョンからのアップグレードはどのように行ないますか? 一段階で? 数段階?
It depends: If you are upgrading from MediaWiki 1.4 or older, you should upgrade to MediaWiki 1.5 first. If you are upgrading from a Latin-1 wiki, use upgrade1_5.php (found in MediaWiki 1.5) to convert the relevant parts of the database to UTF-8 ($wgUseLatin1 needs to be set to true in your LocalSettings.php for this to work). Next, run update.php, and then set the $wgLegacyEncoding option in LocalSettings.php to the encoding previously used by the wiki (e.g. windows-1252). This is basically how Wikipedia and other Wikimedia Foundation sites were upgraded from MediaWiki 1.4 to 1.5 – see the [relevant settings file (warning: huge page!) and some [[wikitech:1.5 upgrade|related notes at Wikitech]]. You may need to upgrade to MediaWiki 1.4 before running the upgrade1.5 script.

If you are upgrading from MediaWiki 1.5 or newer, you can upgrade in one step, from your old version to the latest stable version. The vast majority of reports, as well as automated testing, indicate that doing it in one step works just fine.

信じがたければメーリングリストのこの投稿をお読みください.

If upgrading from a MediaWiki version below 1.19, you may need to add the sha1 field to the revision table manually before running the update script (see bug 48820 and a relevant support desk thread).

最初にバックアップすべきですか？
端的な回答： はい.

長い回答： a) データ量、b) バックアップの作成がどのくらい大変か、c) MySQLのメンテナンスおよび管理にどのくらい自信があるか. それ次第です.

アップグレードが失敗すると、データベースが2つのバージョン間で矛盾した状態のままとなってしまう可能性があります. 重要なテーブルが（更新処理上の）一時的な名前に変わった後、正しく再作成される前に失敗するかもしれません. フィールド定義が間違ったデータ種別に変わってしまうかもしれません. アップグレードではごく稀ですが、取り返しのつかないデータ消失となるかもしれません. 発生したデータの破損は、多くの場合、熟練した管理者によって復元できます.

復旧にはたいてい手間がかかります. バックアップを怠った上でアップグレード関連のデータ破損から復旧する手助けをサポートフォーラムのボランティアに求めるのは、感心されることではありません. バックアップに戻した上で、破損の原因となったアップグレードスクリプトの処理のバグを報告できれば、よりよい成果となります.

自分の LocalSettings.php を使い続けられますか？
はい、ただ、小さな変更を加える必要があるかもしれません. LocalSettings.php の書式の大部分は下位互換性があります. LocalSettings.php の互換性が中止となった変更点は、リリースノートの「configuration changes」セクションに書かれています.

アップグレード中もwikiをオンラインのままにできますか？
はい、できます.

MediaWikiのマイナーリリース間のアップグレードであれば、ソースファイルを更新するだけです.

Note: the following assumes you have command line access. If you are upgrading between major releases of MediaWiki, the preferred procedure is as follows:
 * 1) 新しいディレクトリの中にMediaWikiの新バージョンを展開します
 * 2) 上記新ディレクトリを整える： 旧ディレクトリから現行の LocalSettings.php をコピー、インストールしてある拡張機能とカスタムスキンをコピーします（もしあれば）.
 * 3) In the release notes for the new version, see if any changes need to be made to LocalSettings.php.
 * 4) 旧ディレクトリの LocalSettings.php で読み取り専用モードを有効にします.


 * 1) Run the update script or the web updater in the new directory.
 * 2) 旧ディレクトリから新ディレクトリへ、images サブディレクトリの画像ファイルをコピーします.
 * 3) 旧ディレクトリと新ディレクトリを入れ替えます.

アップグレードする理由

 * ''Subscribe to mediawiki-announce to be notified of new releases.

Because it's usually easy enough, a single step from your version to latest and also via web.

Many upgrades solve security issues which help to keep your wiki and possibly even your host system safe from vandals, while old releases are not supported (see Version lifecycle/ja). New major releases come with new features, which you might want to use. See the release notes for details. In case you need additional arguments to convince your bosses to let you upgrade from a pretty old version:


 * Since 1.9, an undo button is available.
 * Since 1.12, patrolling on Special:NewPages is much easier.
 * Since 1.13, you can rename (move) files.
 * Since 1.14, you can fix double redirects automatically.
 * Since 1.16, InstantCommons is available.
 * If you have appropriate caching, since 1.17 ResourceLoader optimizes pageload speeds a lot.
 * Since 1.17, category sorting makes sense! (especially for non-English letters).
 * In 1.19 the skinning system was reworked making it easier to reuse parts of existing skins in your own skins.
 * Since 1.18 and 1.19, users of all languages and genders are correctly addressed by the interface and logs (before 1.15, no gender at all).
 * Since 1.20, diffs are better readable.

See also the list of the most voted fixed issues on bugzilla.

Also, in MediaWiki 1.18 we started bundling some vital extensions, like a better editor and anti-vandalism tools ConfirmEdit and Nuke. <section end=FAQ />