「メインページ」の版間の差分

提供: N2アーカイブ
ナビゲーションに移動 検索に移動
 
(同じ利用者による、間の14版が非表示)
67行目: 67行目:
 
<br><br><br>
 
<br><br><br>
 
=== <span style="font-size:22px;">MediaWikiのバージョンアップ</span> ===
 
=== <span style="font-size:22px;">MediaWikiのバージョンアップ</span> ===
:MediaWiki の新バージョンが出ています。今回の1.35では「Visual Editor」が使えるようになったとのことです。
+
:MediaWiki の新バージョンが出ています。Ver-1.35から「Visual Editor」が使えるようになったとのことです。
:これは何とかバージョンアップしないといけません。
+
:現時点(2021/12/17)での最新はVer-1.37です。
:以下にバージョンアップ手順を記録しておきましょう(ちゃんとできるか不明ですが...)
+
<br>
 +
:以下にバージョンアップ手順を記録します(ちゃんとVerUpできるか不明ですが...)
 
<br>
 
<br>
 
:1. ファイル転送
 
:1. ファイル転送
 
::[https://www.mediawiki.org/wiki/Manual:Upgrading/ja MediaWikiのヘルプ]を見ると、まず「ファイル転送しろ」となっています。
 
::[https://www.mediawiki.org/wiki/Manual:Upgrading/ja MediaWikiのヘルプ]を見ると、まず「ファイル転送しろ」となっています。
:::「WinSCP」でFTP転送でOKのようなのでこれで行くことにする。
+
:::「WinSCP」でFTP転送できるので、これでファイル転送する。
 
:2. 準備
 
:2. 準備
::上記ヘルプには次に「準備」の項目がある。
+
::上記ヘルプには次に「準備」の項目があり、そこには以下の記述がある。
::そこには以下の記述がある。
 
 
::MediaWikiに含まれるUPGRADE テキストファイルを読みましょう。
 
::MediaWikiに含まれるUPGRADE テキストファイルを読みましょう。
::1. 要件を確認する
+
<br>
::2. RELEASE-NOTES ファイルを読む
 
::3. UPGRADE ファイルを読む
 
::4. 既存のファイルとデータベースをバックアップする
 
::5. 新しいファイルを展開する
 
::6. 拡張機能をアップグレードする
 
::7. 更新スクリプトを実行してデータベースをチェックする
 
::8. アップグレードをテストする
 
::9. Remove leftovers from old installations (古いインストールから残り物を削除します)
 
:となっているが、準備じゃ無いよね。これで完了だ。
 
 
 
一つずつ見ていく。
 
まずは、これ↓
 
::MediaWikiに含まれるUPGRADE テキストファイルを読みましょう。
 
::以下はテキストファイル(英文)のGoogle翻訳(日本語)です。長いので折り畳んでいます。右の「展開する」をクリックして読んでください。
 
<div class="mw-collapsible mw-collapsed" style="margin:0 1em 0 3em">
 
 
::This file provides an overview of the MediaWiki upgrade process.
 
::This file provides an overview of the MediaWiki upgrade process.
 
::このファイルは、MediaWikiのアップグレードプロセスの概要を提供します。
 
::このファイルは、MediaWikiのアップグレードプロセスの概要を提供します。
115行目: 100行目:
 
<br>
 
<br>
 
::Important: Upgrading from releases older than two LTS release is not supported anymore.
 
::Important: Upgrading from releases older than two LTS release is not supported anymore.
::重要:2つのLTSリリース<ref>LTS:Long Term Support 詳細説明は[https://linuc.org/study/knowledge/453/ こちら参照]</ref>より古いリリースからのアップグレードはサポートされなくなりました。
+
::重要:2つのLTS<ref>LTS:Long Term Support 詳細説明は[https://linuc.org/study/knowledge/453/ こちら参照]</ref>版より古いVersionからのアップグレードは不可能となりました。
 
::If you want to upgrade from an old version, please upgrade to a more recent LTS version first, then to this version.
 
::If you want to upgrade from an old version, please upgrade to a more recent LTS version first, then to this version.
::古いバージョンからアップグレードする場合は、最初に新しいLTSバージョンにアップグレードしてから、このバージョンにアップグレードしてください。
+
::古いバージョンからアップグレードする場合は、最初に新しいLTS Versionにアップグレードした後に、このバージョン(1.37)にアップグレードしてください。
 
::Currently any upgrade from any version older than 1.27 will fail.
 
::Currently any upgrade from any version older than 1.27 will fail.
::現在、1.27より古いバージョンからのアップグレードは失敗します。
+
::現在、Version-1.27より古いバージョンからのアップグレードは失敗します。
:と言っているが、今回は1.34.2なので問題ないと思われる。
+
:と言っているが、今回は旧バージョンが「1.34.2」なので問題ないと思われる。
 
<br>
 
<br>
=====リリースノートを参照してください=====
+
::1. 要件を確認する(右の「展開する」クリックで詳細表示)
 +
<div class="mw-collapsible mw-collapsed" style="margin:0 1em 0 3em">
 +
:::MediaWiki 1.37 の要件は以下の通りです:
 +
:::PHP 7.3.19/7.4.3+
 +
:::MySQL 5.5.8+ (または同等の MariaDB)
 +
:::これは、5.7だからOK。
 +
</div>
 +
<br>
 +
::2. RELEASE-NOTES ファイルを読む
 +
<div class="mw-collapsible mw-collapsed" style="margin:0 1em 0 3em">
 
::Before doing anything, stop and consult the release notes supplied with the new version of the software.
 
::Before doing anything, stop and consult the release notes supplied with the new version of the software.
::何かをする前に、ソフトウェアの新しいバージョンに付属しているリリースノートを停止して参照してください。
+
::何かをする前に、一度止まって、ソフトウェアの新しいバージョンに付属しているリリースノートを参照してください。
 
::These detail bug fixes, new features and functionality, and any particular points that may need to be noted during the upgrade process.
 
::These detail bug fixes, new features and functionality, and any particular points that may need to be noted during the upgrade process.
::これらの詳細なバグ修正、新機能と機能、およびアップグレードプロセス中に注意する必要がある特定のポイント。
+
::これらの詳細なバグ修正、新しい特長と新機能、そして特定のポイントなどは、アップグレードプロセス中に注意する必要があります。
 +
</div>
 
<br>
 
<br>
=====最初にバックアップ=====
+
::3. UPGRADE ファイルを読む → これって「最新Verのファイル解凍して、新たなフォルダーを作成しそのフォルダーにコピーする」という意味だろうか?→いや違う。
 +
<div class="mw-collapsible mw-collapsed" style="margin:0 1em 0 3em">
 +
::Download the files for the new version of the software. These are available as a compressed "tar" archive from the Wikimedia Download Service
 +
::(https://releases.wikimedia.org/mediawiki/).
 +
<br>
 +
::ソフトウェアの新しいバージョンのファイルをダウンロードします。 これらは、ウィキメディアダウンロードサービスから圧縮された「tar」アーカイブとして入手できます。
 +
::(https://releases.wikimedia.org/mediawiki/)。
 +
<br>
 +
::You can also obtain the new files directly from our Git source code repository.
 +
::新しいファイルは、Gitソースコードリポジトリから直接入手することもできます。
 +
::Replace the existing MediaWiki files with the new. You should preserve the LocalSettings.php file and the "extensions" and "images" directories.
 +
::既存のMediaWikiファイルを新しいものに置き換えます。 LocalSettings.phpファイルと「extensions」および「images」ディレクトリを保持する必要があります。
 +
::Depending upon your configuration, you may also need to preserve additional directories, including a custom upload directory ($wgUploadDirectory), deleted file archives, and any custom skins.
 +
::構成によっては、カスタムアップロードディレクトリ($ wgUploadDirectory)、削除されたファイルアーカイブ、カスタムスキンなどの追加のディレクトリを保持する必要がある場合もあります。
 +
</div>
 +
<br>
 +
::4. 既存のファイルとデータベースをバックアップする
 +
<div class="mw-collapsible mw-collapsed" style="margin:0 1em 0 3em">
 
::It is imperative that, prior to attempting an upgrade of the database schema, you take a complete backup of your wiki database and files and verify it.
 
::It is imperative that, prior to attempting an upgrade of the database schema, you take a complete backup of your wiki database and files and verify it.
 
::データベーススキーマのアップグレードを試みる前に、wikiデータベースとファイルの完全なバックアップを取り、それを検証することが不可欠です。
 
::データベーススキーマのアップグレードを試みる前に、wikiデータベースとファイルの完全なバックアップを取り、それを検証することが不可欠です。
 
::While the upgrade scripts are somewhat robust, there is no guarantee that things will not fail, leaving the database in an inconsistent state.
 
::While the upgrade scripts are somewhat robust, there is no guarantee that things will not fail, leaving the database in an inconsistent state.
::アップグレードスクリプトはある程度堅牢ですが、データベースが一貫性のない状態のままになって失敗しないという保証はありません。
+
::アップグレードスクリプトはある程度堅牢ですが、失敗しないという保証はありませんし、データベースが一貫性のない状態になってしまうこともあります。
 
<br>
 
<br>
 
::https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Backing_up_a_wiki is an overview of the backup process.
 
::https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Backing_up_a_wiki is an overview of the backup process.
::「https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Backing_up_a_wiki」は、バックアッププロセスの概要です。
+
::「[https://www.mediawiki.org/wiki/Manual:Backing_up_a_wiki/ja 上記URL]」には、バックアッププロセスの概要が記載されています。
 
::You should also refer to the documentation for your database management system for information on backing up a database,
 
::You should also refer to the documentation for your database management system for information on backing up a database,
::データベースのバックアップについては、データベース管理システムのドキュメントも参照してください。
+
::データベースのバックアップに関する情報は、データベース管理システムのドキュメントを参照ください。
 
::and to your operating system documentation for information on making copies of files.
 
::and to your operating system documentation for information on making copies of files.
::そして、ファイルのコピーの作成については、オペレーティングシステムのドキュメントを参照してください。
+
::そして、ファイルのコピーについては、使用しているOSのドキュメントを参照してください。
 +
 
 +
</div>
 
<br>
 
<br>
=====ファイルのアップグレードを実行します=====
+
::5. 新しいファイルを展開する
 +
<div class="mw-collapsible mw-collapsed" style="margin:0 1em 0 3em">
 
::Download the files for the new version of the software. These are available as a compressed "tar" archive from the Wikimedia Download Service
 
::Download the files for the new version of the software. These are available as a compressed "tar" archive from the Wikimedia Download Service
(https://releases.wikimedia.org/mediawiki/).
+
::(https://releases.wikimedia.org/mediawiki/).
 
::ソフトウェアの新しいバージョンのファイルをダウンロードします。 これらは、ウィキメディアダウンロードサービスから圧縮された「tar」アーカイブとして入手できます。
 
::ソフトウェアの新しいバージョンのファイルをダウンロードします。 これらは、ウィキメディアダウンロードサービスから圧縮された「tar」アーカイブとして入手できます。
(https://releases.wikimedia.org/mediawiki/)。
+
::(https://releases.wikimedia.org/mediawiki/)。
 +
<br>
 
::You can also obtain the new files directly from our Git source code repository.
 
::You can also obtain the new files directly from our Git source code repository.
 
::新しいファイルは、Gitソースコードリポジトリから直接入手することもできます。
 
::新しいファイルは、Gitソースコードリポジトリから直接入手することもできます。
152行目: 168行目:
 
::Depending upon your configuration, you may also need to preserve additional directories, including a custom upload directory ($wgUploadDirectory), deleted file archives, and any custom skins.
 
::Depending upon your configuration, you may also need to preserve additional directories, including a custom upload directory ($wgUploadDirectory), deleted file archives, and any custom skins.
 
::構成によっては、カスタムアップロードディレクトリ($ wgUploadDirectory)、削除されたファイルアーカイブ、カスタムスキンなどの追加のディレクトリを保持する必要がある場合もあります。
 
::構成によっては、カスタムアップロードディレクトリ($ wgUploadDirectory)、削除されたファイルアーカイブ、カスタムスキンなどの追加のディレクトリを保持する必要がある場合もあります。
 +
</div>
 
<br>
 
<br>
=====データベースのアップグレードを実行します=====
+
::6. 拡張機能をアップグレードする
::As of 1.21, it is possible to separate schema changes (i.e. adding, dropping,
+
<div class="mw-collapsible mw-collapsed" style="margin:0 1em 0 3em">
::1.21以降、スキーマの変更を分離することができます(つまり、追加、削除、
+
::Extensions usually need to be upgraded at the same time as the MediaWiki core.
::or changing tables, fields, or indices) from all other database changes (e.g. populating fields).
+
::拡張機能は通常、MediaWikiコアと同時にアップグレードする必要があります。
::または、他のすべてのデータベースの変更(フィールドへの入力など)からテーブル、フィールド、またはインデックスを変更します。
+
::In MediaWiki 1.14 some extensions were migrated into the core.
::If you need this capability, see "From the command line" below.
+
::MediaWiki 1.14では、いくつかの拡張機能がコアに移行されました。
::この機能が必要な場合は、以下の「コマンドラインから」を参照してください。
+
::Please see the HISTORY section "Migrated extensions" and disable these extensions in your LocalSettings.php
 +
::HISTORYセクションの「移行された拡張機能」を参照し、LocalSettings.phpでこれらの拡張機能を無効にしてください
 +
</div>
 
<br>
 
<br>
====== Webから======
+
::7. 更新スクリプトを実行してデータベースをチェックする
::If you browse to the Web-based installation script (usually at
+
<div class="mw-collapsible mw-collapsed" style="margin:0 1em 0 3em">
./mw-config/index.php) from your wiki installation you can follow the script and upgrade your database in place.
+
::コマンドラインからデータベースのアップグレードを実行する、ということですかね。
::Webベースのインストールスクリプトを参照する場合(通常は ./mw-config/index.php)wikiのインストールから、スクリプトに従ってデータベースを適切にアップグレードできます。
 
<br>
 
======コマンドラインから======
 
 
::From the command line, browse to the "maintenance" directory and run the
 
::From the command line, browse to the "maintenance" directory and run the
::update.php script to check and update the schema.  
+
::update.php script to check and update the schema.
 
::コマンドラインから「maintenance」ディレクトリに移動して、「update.php」を実行することでアップデートできるようだ。
 
::コマンドラインから「maintenance」ディレクトリに移動して、「update.php」を実行することでアップデートできるようだ。
 
::This will insert missing tables, update existing tables, and move data around as needed.
 
::This will insert missing tables, update existing tables, and move data around as needed.
176行目: 192行目:
 
<br>
 
<br>
 
::If you need to separate out the schema changes so they can be run by someone with more privileges,
 
::If you need to separate out the schema changes so they can be run by someone with more privileges,
:: then you can use the --schema option to produce a text file with the necessary commands.
+
::then you can use the --schema option to produce a text file with the necessary commands.
 
::You can use --schema, --noschema, $wgAllowSchemaUpdates as well as proper database permissions to enforce this separation.
 
::You can use --schema, --noschema, $wgAllowSchemaUpdates as well as proper database permissions to enforce this separation.
 
::より多くの特権を持つ誰かが実行できるようにスキーマの変更を分離する必要がある場合は、次に、-schemaオプションを使用して、必要なコマンドを含むテキストファイルを作成できます。
 
::より多くの特権を持つ誰かが実行できるようにスキーマの変更を分離する必要がある場合は、次に、-schemaオプションを使用して、必要なコマンドを含むテキストファイルを作成できます。
 
::--schema、-noschema、$ wgAllowSchemaUpdates、および適切なデータベース権限を使用して、この分離を強制できます。
 
::--schema、-noschema、$ wgAllowSchemaUpdates、および適切なデータベース権限を使用して、この分離を強制できます。
 +
</div>
 
<br>
 
<br>
 +
::8. アップグレードをテストする
 +
<div class="mw-collapsible mw-collapsed" style="margin:0 1em 0 3em">
 +
::It makes sense to test your wiki immediately following any kind of maintenance procedure,
 +
::あらゆる種類のメンテナンス手順の直後にウィキをテストすることは理にかなっています。
 +
::and especially after upgrading; check that page views and edits work normally, that special pages continue to function, etc.,
 +
::特にアップグレード後。 ページの表示と編集が正常に機能すること、特別なページが引き続き機能することなどを確認します。
 +
::and correct any errors and quirks which reveal themselves.
 +
::そして、自分自身を明らかにするエラーや癖を修正します。
 +
::You should also test any extensions, and upgrade these if necessary.
 +
::また、拡張機能をテストし、必要に応じてアップグレードする必要があります。
 +
</div>
 +
<br>
 +
::9. Remove leftovers from old installations (古いインストールから残り物を削除します)
 +
:となっている。
  
 
===Configuration settings(構成設定)を確認してください===
 
===Configuration settings(構成設定)を確認してください===
190行目: 221行目:
 
::アップグレードするときは、リリースノートを参照して、MediaWikiの予想される動作を変更する構成の変更を確認してください。
 
::アップグレードするときは、リリースノートを参照して、MediaWikiの予想される動作を変更する構成の変更を確認してください。
 
<br>
 
<br>
===インストールされている拡張機能を確認してください===
 
::Extensions usually need to be upgraded at the same time as the MediaWiki core.
 
::拡張機能は通常、MediaWikiコアと同時にアップグレードする必要があります。
 
::In MediaWiki 1.14 some extensions were migrated into the core.
 
::MediaWiki 1.14では、いくつかの拡張機能がコアに移行されました。
 
::Please see the HISTORY section "Migrated extensions" and disable these extensions in your LocalSettings.php
 
::HISTORYセクションの「移行された拡張機能」を参照し、LocalSettings.phpでこれらの拡張機能を無効にしてください
 
<br>
 
===テスト===
 
::It makes sense to test your wiki immediately following any kind of maintenance procedure,
 
::あらゆる種類のメンテナンス手順の直後にウィキをテストすることは理にかなっています。
 
::and especially after upgrading; check that page views and edits work normally, that special pages continue to function, etc.,
 
::特にアップグレード後。 ページの表示と編集が正常に機能すること、特別なページが引き続き機能することなどを確認します。
 
::and correct any errors and quirks which reveal themselves.
 
::そして、自分自身を明らかにするエラーや癖を修正します。
 
::You should also test any extensions, and upgrade these if necessary.
 
::また、拡張機能をテストし、必要に応じてアップグレードする必要があります。
 
<br>
 
</div>
 
 
<br><br><br>
 
<br><br><br>
:1. 要件の確認
 
::MediaWiki 1.37 の要件は以下の通りです:
 
::PHP 7.3.19/7.4.3+
 
:::
 
::MySQL 5.5.8+ (または同等の MariaDB)
 
:::これは、5.7だからOK。
 
 
 
 
::バックアップしろ
 
::バックアップしろ
 
::その概要は[https://www.mediawiki.org/wiki/Manual:Backing_up_a_wiki/ja Manual:ウィキのバックアップ]に記載してある。
 
::その概要は[https://www.mediawiki.org/wiki/Manual:Backing_up_a_wiki/ja Manual:ウィキのバックアップ]に記載してある。
 +
<br>
 +
:データベースのバックアップ手順
 +
::コマンドラインでmysqldumpを実行する
 +
::最も簡便なのは、MySQLに標準で付属するmysqldumpを用いることである。これは、バックアップ対象のデータベース名やテーブル名を指定してダンプファイルを作成することができるコマンドラインアプリケーションである。
 +
<br>
 +
::まずLocalSettings.phpに次の行を挿入します
 +
<br>
 +
::$wgReadOnly = 'Dumping Database, Access will be restored shortly';
 +
::これは、ダンプが完了するとすぐに削除することができます。
 +
<br>
 +
::Linux/UNIX シェル上で実行するコマンドの例:
 +
<br>
 +
::mysqldump -h hostname -u userid -p --default-character-set=whatever dbname > backup.sql
 +
<br>
 +
::hostname、userid、whatever、dbnameを適宜変更します。 4つはすべて LocalSettings.php (LSP) ファイルにあります。 hostname may be found under $wgDBserver; by default it is localhost. useridは $wgDBuser の下にありますが、whatever は ::$wgDBTableOptions の下にあり、DEFAULT CHARSET= の後にリストされます。 whateverが指定されていない場合、mysqldumpは既定のutf8を使用するか、古いバージョンのMySQLを使用する場合はlatin1を使用します。 dbnameは $wgDBname にあります。
 +
::コマンドラインからこの行を実行すると、mysqldumpはサーバーのパスワードを要求します (LSPの Manual:$wgDBpassword にあります)。
 +
<br>
 +
::コマンドライン パラメーターの完全な一覧については mysqldump を参照してください。
 +
<br>
 +
::より小さい出力ファイルの場合、mysqldump の出力を以下のように gzip にパイプすることもできます
 +
<br>
 +
::mysqldump -h hostname -u userid -p dbname | gzip > backup.sql.gz
 +
::Some newer versions of MySQL might show an error about tablespaces and PROCESS privilege. MediaWiki does not use tablespaces. The solution is to add the --no-tablespaces option to the command:
 +
<br>
 +
::mysqldump --no-tablespaces -h hostname -u userid -p dbname | gzip > backup.sql.gz
 +
::同様のmysqldumpコマンドを使用して、代わりに--xmlパラメータを含めることでXML出力を生成することができます。
 +
<br>
 +
::mysqldump -h hostname -u userid -p --xml dbname > backup.xml
 +
::gzipにパイプでファイルを圧縮する
 +
<br>
 +
::mysqldump -h hostname -u userid -p --xml dbname | gzip > backup.xml.gz
 +
::また、画像、ロゴ、拡張機能など、必要に応じてwikiのファイルシステムコンポーネントをバックアップすることを忘れないでください
 +
<br><br>
 +
<br>
 +
:ファイルシステムのバックアップ
 +
::データベースに保存するよりもファイルシステムに保存した方が適切であるような要素についてはファイルシステムの中に保存されます。
 +
::例えばサイトの設定ファイル ($1、$2 (最終的に 1.23 で除去されました))や画像ファイル (削除された画像、サムネイル、数式やSVGファイルも含む)、外装のカスタマイズ設定、拡張機能ファイルなどが該当します。
 +
::The most important of these are LocalSettings.php and uploaded files in the images/ directory (including deleted files, thumbnails, and rendered math and SVG images, if applicable).
 +
<br>
 +
::これらのファイルをバックアップするのに最適な方法は、.tarのようなアーカイブファイル(必要が有れば圧縮して)に纏めることです。WindowsであればWinZipや7-Zipといったアプリケーションが使用できます。
 +
<br>
 +
::Linux の場合でウィキが /srv/www/htdocs/wiki に格納されているとすると
 +
<br>
 +
::tar zcvhf wikidata.tgz /srv/www/htdocs/wiki
 +
::It should be possible to backup the entire "wiki" folder in "htdocs" if using XAMPP.
 +
<br><br>
 +
:Configuration files
 +
::LocalSettings.php is the most important of these, but a wiki might also have things like .htaccess or other web server configuration files that should be backed up.
 +
<br>
 +
:Uploaded files
 +
::Files uploaded to the wiki are by default put into the images/ directory, separated into subdirectories such as images/8/8f. There are also other directories such as images/archive/ and images/deleted/. These should all be backed up.
 +
<br>
 +
T::he images/thumb/ can be backed up along with everything else, but can optionally be excluded in order to save backup space.
 +
::This directory stores the derived thumbnails of images and other files; generally multiple thumbnails per wiki file.
 +
::After restoring from backup, these thumbnails will be recreated as required (although depending on $wgGenerateThumbnailOnParse this may need to be a manual process).
  
 
<br><br>
 
<br><br>
 +
 
:こちら↓の説明が分かりやすい。
 
:こちら↓の説明が分かりやすい。
 
:[https://dococo.jp/index.php?title=MediaWiki%E3%83%90%E3%83%83%E3%82%AF%E3%82%A2%E3%83%83%E3%83%97/%E3%83%AA%E3%82%B9%E3%83%88%E3%82%A2%E3%82%92%E5%88%86%E3%81%8B%E3%82%8A%E3%82%84%E3%81%99%E3%81%8F%E8%AA%AC%E6%98%8E MediaWikiバックアップ/リストアを分かりやすく説明]
 
:[https://dococo.jp/index.php?title=MediaWiki%E3%83%90%E3%83%83%E3%82%AF%E3%82%A2%E3%83%83%E3%83%97/%E3%83%AA%E3%82%B9%E3%83%88%E3%82%A2%E3%82%92%E5%88%86%E3%81%8B%E3%82%8A%E3%82%84%E3%81%99%E3%81%8F%E8%AA%AC%E6%98%8E MediaWikiバックアップ/リストアを分かりやすく説明]

2021年12月17日 (金) 16:56時点における最新版

N2アーカイブの目的について

このサイトは「さくらインターネット」で、MediaWikiのバージョンアップができるかどうかを確認するためのものです。


バージョンアップ時、以下の項目が正しく移行できているかについて確認します。
1. 登録されたアカウントが生きているか、PWは保存されているか、各種権限は保存されているか
2. アップロードした画像ファイルが正しく表示されるか
3. ページ間や他のサイトへのリンクが変化していないか
4. CSSやサイドメニュー表示は正常に作動しているか


「バージョンアップ」後、上記項目がすべて正常に作動していれば、「八中・小山台デジタルアーカイブ」でのバージョンアップ作業を実施します。
関係各位のご協力をよろしくお願いいたします。









こちらには、いろいろな「覚え」を記載しておくつもりです。
年のせいか、何でもすぐに忘れてしまうので「備忘録」として活用したい。




各種ページへのリンク

カテゴリ

カテゴリ表示/非表示
1. ○○○○○     6. ○○○○○ 11. ○○○○○
2. レンタルサーバーへのMediaWikiインストール    7. ○○○○○ 12. ○○○○○   
3. MediaWikiの各種設定について 8. ○○○○○ 13. ○○○○○
4. MediaWikiヘルプ     9. 雑多な情報 14. ○○○○○
5. ○○○○○     10. ○○○○○ 15. ○○○○○
 





MediaWikiインストール

「MediaWiki」は「Wikipedia」と同じ枠組みを簡単に作れるすばらしいソフトです。
「よーしオイラも自前のWikipediaを構築してみよう!」と思い立って始めたのは良かったのですが、
Web上の情報が少ないのと、たまにあっても「古~い」情報だったり、「Linuxコマンド堪能なお方」による、難解なコマンド羅列のご説明だったりして困りました。
さらに、本家本元の「MediaWiki」サイトのヘルプが、これまた日本語とは思えない「超難解!」。 Linuxコマンド以上の難易度であります。orz
そこで「まずはやってみよう」と始めて、さまざまな「試行錯誤」を繰り返し、なんとかできるようになりました(Google様と、行き詰まったときに気晴らしに読んだ小説・マンガのおかげです)。


以下のリンクは「試行錯誤」の結果です。まだ、良く分かっていないところもありますが、同じような境遇の方のお役に立てれば幸いです。
1. さくらのレンタルサーバー
2. XServer (このサイトを置いているレンタルサーバーです)
3. StarFreeサーバー
4. XREAサーバー
5. XFreeサーバーについて(未インストール)



MediaWikiの各種設定

インストールが終わったら、初期設定やその他の設定をすると快適に使えるようになります。
主な設定項目は以下のとおりです。
1. 「メインページ」以外を非公開にする
2. 「アカウントの登録」と「権限設定」
3. 「メインページ」のカスタマイズ
4. 「サイドバー(左のメニュー)」のカスタマイズ




MediaWikiのバージョンアップ

MediaWiki の新バージョンが出ています。Ver-1.35から「Visual Editor」が使えるようになったとのことです。
現時点(2021/12/17)での最新はVer-1.37です。


以下にバージョンアップ手順を記録します(ちゃんとVerUpできるか不明ですが...)


1. ファイル転送
MediaWikiのヘルプを見ると、まず「ファイル転送しろ」となっています。
「WinSCP」でFTP転送できるので、これでファイル転送する。
2. 準備
上記ヘルプには次に「準備」の項目があり、そこには以下の記述がある。
MediaWikiに含まれるUPGRADE テキストファイルを読みましょう。


This file provides an overview of the MediaWiki upgrade process.
このファイルは、MediaWikiのアップグレードプロセスの概要を提供します。
For help with specific problems, you should check:
特定の問題のヘルプについては、以下を確認する必要があります。


the docs at https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents
https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents のドキュメント
the mediawiki-l mailing list archive at https://lists.wikimedia.org/pipermail/mediawiki-l/
mediawiki-lメーリングリストアーカイブ https://lists.wikimedia.org/pipermail/mediawiki-l/
and the bug tracker at https://phabricator.wikimedia.org/ … for information and workarounds to common issues.
およびhttps://phabricator.wikimedia.org/のバグトラッカー …一般的な問題の情報と回避策について。


この上に書かれている、3個のURLだが、英語堪能な方以外は無視して良いだろう。というか読めないんだからどーしようもない。
運良く、自分のトラブルに該当するものを見つけられて、何とか意味が分かれば「それは祝着でしたな!」となる。


概要

We provide comprehensive documentation on upgrading to the latest version of the software at https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Upgrading.
ソフトウェアの最新バージョンへのアップグレードに関する包括的なドキュメントは、https://www.mediawiki.org/wiki/Special:MyLanguage / Manual:Upgradingで提供されています。


Important: Upgrading from releases older than two LTS release is not supported anymore.
重要:2つのLTS[1]版より古いVersionからのアップグレードは不可能となりました。
If you want to upgrade from an old version, please upgrade to a more recent LTS version first, then to this version.
古いバージョンからアップグレードする場合は、最初に新しいLTS Versionにアップグレードした後に、このバージョン(1.37)にアップグレードしてください。
Currently any upgrade from any version older than 1.27 will fail.
現在、Version-1.27より古いバージョンからのアップグレードは失敗します。
と言っているが、今回は旧バージョンが「1.34.2」なので問題ないと思われる。


1. 要件を確認する(右の「展開する」クリックで詳細表示)
MediaWiki 1.37 の要件は以下の通りです:
PHP 7.3.19/7.4.3+
MySQL 5.5.8+ (または同等の MariaDB)
これは、5.7だからOK。


2. RELEASE-NOTES ファイルを読む
Before doing anything, stop and consult the release notes supplied with the new version of the software.
何かをする前に、一度止まって、ソフトウェアの新しいバージョンに付属しているリリースノートを参照してください。
These detail bug fixes, new features and functionality, and any particular points that may need to be noted during the upgrade process.
これらの詳細なバグ修正、新しい特長と新機能、そして特定のポイントなどは、アップグレードプロセス中に注意する必要があります。


3. UPGRADE ファイルを読む → これって「最新Verのファイル解凍して、新たなフォルダーを作成しそのフォルダーにコピーする」という意味だろうか?→いや違う。
Download the files for the new version of the software. These are available as a compressed "tar" archive from the Wikimedia Download Service
(https://releases.wikimedia.org/mediawiki/).


ソフトウェアの新しいバージョンのファイルをダウンロードします。 これらは、ウィキメディアダウンロードサービスから圧縮された「tar」アーカイブとして入手できます。
https://releases.wikimedia.org/mediawiki/)。


You can also obtain the new files directly from our Git source code repository.
新しいファイルは、Gitソースコードリポジトリから直接入手することもできます。
Replace the existing MediaWiki files with the new. You should preserve the LocalSettings.php file and the "extensions" and "images" directories.
既存のMediaWikiファイルを新しいものに置き換えます。 LocalSettings.phpファイルと「extensions」および「images」ディレクトリを保持する必要があります。
Depending upon your configuration, you may also need to preserve additional directories, including a custom upload directory ($wgUploadDirectory), deleted file archives, and any custom skins.
構成によっては、カスタムアップロードディレクトリ($ wgUploadDirectory)、削除されたファイルアーカイブ、カスタムスキンなどの追加のディレクトリを保持する必要がある場合もあります。


4. 既存のファイルとデータベースをバックアップする
It is imperative that, prior to attempting an upgrade of the database schema, you take a complete backup of your wiki database and files and verify it.
データベーススキーマのアップグレードを試みる前に、wikiデータベースとファイルの完全なバックアップを取り、それを検証することが不可欠です。
While the upgrade scripts are somewhat robust, there is no guarantee that things will not fail, leaving the database in an inconsistent state.
アップグレードスクリプトはある程度堅牢ですが、失敗しないという保証はありませんし、データベースが一貫性のない状態になってしまうこともあります。


https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Backing_up_a_wiki is an overview of the backup process.
上記URL」には、バックアッププロセスの概要が記載されています。
You should also refer to the documentation for your database management system for information on backing up a database,
データベースのバックアップに関する情報は、データベース管理システムのドキュメントを参照ください。
and to your operating system documentation for information on making copies of files.
そして、ファイルのコピーについては、使用しているOSのドキュメントを参照してください。


5. 新しいファイルを展開する
Download the files for the new version of the software. These are available as a compressed "tar" archive from the Wikimedia Download Service
(https://releases.wikimedia.org/mediawiki/).
ソフトウェアの新しいバージョンのファイルをダウンロードします。 これらは、ウィキメディアダウンロードサービスから圧縮された「tar」アーカイブとして入手できます。
https://releases.wikimedia.org/mediawiki/)。


You can also obtain the new files directly from our Git source code repository.
新しいファイルは、Gitソースコードリポジトリから直接入手することもできます。
Replace the existing MediaWiki files with the new. You should preserve the LocalSettings.php file and the "extensions" and "images" directories.
既存のMediaWikiファイルを新しいものに置き換えます。 LocalSettings.phpファイルと「extensions」および「images」ディレクトリを保持する必要があります。
Depending upon your configuration, you may also need to preserve additional directories, including a custom upload directory ($wgUploadDirectory), deleted file archives, and any custom skins.
構成によっては、カスタムアップロードディレクトリ($ wgUploadDirectory)、削除されたファイルアーカイブ、カスタムスキンなどの追加のディレクトリを保持する必要がある場合もあります。


6. 拡張機能をアップグレードする
Extensions usually need to be upgraded at the same time as the MediaWiki core.
拡張機能は通常、MediaWikiコアと同時にアップグレードする必要があります。
In MediaWiki 1.14 some extensions were migrated into the core.
MediaWiki 1.14では、いくつかの拡張機能がコアに移行されました。
Please see the HISTORY section "Migrated extensions" and disable these extensions in your LocalSettings.php
HISTORYセクションの「移行された拡張機能」を参照し、LocalSettings.phpでこれらの拡張機能を無効にしてください


7. 更新スクリプトを実行してデータベースをチェックする
コマンドラインからデータベースのアップグレードを実行する、ということですかね。
From the command line, browse to the "maintenance" directory and run the
update.php script to check and update the schema.
コマンドラインから「maintenance」ディレクトリに移動して、「update.php」を実行することでアップデートできるようだ。
This will insert missing tables, update existing tables, and move data around as needed.
In most cases, this is successful and nothing further needs to be done.
この「update.php」スクリプトの実行で、テーブル、既存のテーブルを更新し、必要に応じてデータを移動します。
ほとんどの場合、これは成功するので、これ以上何もする必要はありません。


If you need to separate out the schema changes so they can be run by someone with more privileges,
then you can use the --schema option to produce a text file with the necessary commands.
You can use --schema, --noschema, $wgAllowSchemaUpdates as well as proper database permissions to enforce this separation.
より多くの特権を持つ誰かが実行できるようにスキーマの変更を分離する必要がある場合は、次に、-schemaオプションを使用して、必要なコマンドを含むテキストファイルを作成できます。
--schema、-noschema、$ wgAllowSchemaUpdates、および適切なデータベース権限を使用して、この分離を強制できます。


8. アップグレードをテストする
It makes sense to test your wiki immediately following any kind of maintenance procedure,
あらゆる種類のメンテナンス手順の直後にウィキをテストすることは理にかなっています。
and especially after upgrading; check that page views and edits work normally, that special pages continue to function, etc.,
特にアップグレード後。 ページの表示と編集が正常に機能すること、特別なページが引き続き機能することなどを確認します。
and correct any errors and quirks which reveal themselves.
そして、自分自身を明らかにするエラーや癖を修正します。
You should also test any extensions, and upgrade these if necessary.
また、拡張機能をテストし、必要に応じてアップグレードする必要があります。


9. Remove leftovers from old installations (古いインストールから残り物を削除します)
となっている。

Configuration settings(構成設定)を確認してください

The names of configuration variables, and their default values and purposes, can change between release branches,
構成変数の名前、およびそれらのデフォルト値と目的は、リリースブランチ間で変更できます。
e.g. $wgDisableUploads in 1.4 is replaced with $wgEnableUploads in later versions.
例えば 1.4の$ wgDisableUploadsは、それ以降のバージョンでは$ wgEnableUploadsに置き換えられています。
When upgrading, consult the release notes to check for configuration changes which would alter the expected behavior of MediaWiki.
アップグレードするときは、リリースノートを参照して、MediaWikiの予想される動作を変更する構成の変更を確認してください。





バックアップしろ
その概要はManual:ウィキのバックアップに記載してある。


データベースのバックアップ手順
コマンドラインでmysqldumpを実行する
最も簡便なのは、MySQLに標準で付属するmysqldumpを用いることである。これは、バックアップ対象のデータベース名やテーブル名を指定してダンプファイルを作成することができるコマンドラインアプリケーションである。


まずLocalSettings.phpに次の行を挿入します


$wgReadOnly = 'Dumping Database, Access will be restored shortly';
これは、ダンプが完了するとすぐに削除することができます。


Linux/UNIX シェル上で実行するコマンドの例:


mysqldump -h hostname -u userid -p --default-character-set=whatever dbname > backup.sql


hostname、userid、whatever、dbnameを適宜変更します。 4つはすべて LocalSettings.php (LSP) ファイルにあります。 hostname may be found under $wgDBserver; by default it is localhost. useridは $wgDBuser の下にありますが、whatever は ::$wgDBTableOptions の下にあり、DEFAULT CHARSET= の後にリストされます。 whateverが指定されていない場合、mysqldumpは既定のutf8を使用するか、古いバージョンのMySQLを使用する場合はlatin1を使用します。 dbnameは $wgDBname にあります。
コマンドラインからこの行を実行すると、mysqldumpはサーバーのパスワードを要求します (LSPの Manual:$wgDBpassword にあります)。


コマンドライン パラメーターの完全な一覧については mysqldump を参照してください。


より小さい出力ファイルの場合、mysqldump の出力を以下のように gzip にパイプすることもできます


mysqldump -h hostname -u userid -p dbname | gzip > backup.sql.gz
Some newer versions of MySQL might show an error about tablespaces and PROCESS privilege. MediaWiki does not use tablespaces. The solution is to add the --no-tablespaces option to the command:


mysqldump --no-tablespaces -h hostname -u userid -p dbname | gzip > backup.sql.gz
同様のmysqldumpコマンドを使用して、代わりに--xmlパラメータを含めることでXML出力を生成することができます。


mysqldump -h hostname -u userid -p --xml dbname > backup.xml
gzipにパイプでファイルを圧縮する


mysqldump -h hostname -u userid -p --xml dbname | gzip > backup.xml.gz
また、画像、ロゴ、拡張機能など、必要に応じてwikiのファイルシステムコンポーネントをバックアップすることを忘れないでください




ファイルシステムのバックアップ
データベースに保存するよりもファイルシステムに保存した方が適切であるような要素についてはファイルシステムの中に保存されます。
例えばサイトの設定ファイル ($1、$2 (最終的に 1.23 で除去されました))や画像ファイル (削除された画像、サムネイル、数式やSVGファイルも含む)、外装のカスタマイズ設定、拡張機能ファイルなどが該当します。
The most important of these are LocalSettings.php and uploaded files in the images/ directory (including deleted files, thumbnails, and rendered math and SVG images, if applicable).


これらのファイルをバックアップするのに最適な方法は、.tarのようなアーカイブファイル(必要が有れば圧縮して)に纏めることです。WindowsであればWinZipや7-Zipといったアプリケーションが使用できます。


Linux の場合でウィキが /srv/www/htdocs/wiki に格納されているとすると


tar zcvhf wikidata.tgz /srv/www/htdocs/wiki
It should be possible to backup the entire "wiki" folder in "htdocs" if using XAMPP.



Configuration files
LocalSettings.php is the most important of these, but a wiki might also have things like .htaccess or other web server configuration files that should be backed up.


Uploaded files
Files uploaded to the wiki are by default put into the images/ directory, separated into subdirectories such as images/8/8f. There are also other directories such as images/archive/ and images/deleted/. These should all be backed up.


T::he images/thumb/ can be backed up along with everything else, but can optionally be excluded in order to save backup space.

This directory stores the derived thumbnails of images and other files; generally multiple thumbnails per wiki file.
After restoring from backup, these thumbnails will be recreated as required (although depending on $wgGenerateThumbnailOnParse this may need to be a manual process).



こちら↓の説明が分かりやすい。
MediaWikiバックアップ/リストアを分かりやすく説明














脚注:

  1. LTS:Long Term Support 詳細説明はこちら参照