M204wiki:Database download: Difference between revisions
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
The content of {{SITENAME}} is available for download, provided only that no copyright notices may be removed or altered. | The content of {{SITENAME}} is available for download, provided only that no copyright notices may be removed or altered. Each download is a zip archive containing an XML dump of the wiki pages, suitable for loading into your own installation of MediaWiki. The "full" archive also contains a tar file with all of the uploaded images and other objects such as PDF files. | ||
==How to download a copy of {{SITENAME}}== | ==How to download a copy of {{SITENAME}}== | ||
{| class="wikitable" | |||
! File !! Contents !! Page history? | |||
|- | |||
| <code>{{SERVER}}{{SCRIPTPATH}}/images/M204wiki_current.zip</code> || <code>M204wiki.current.xml</code>: the latest version of each page || No | |||
|- | |||
| <code>{{SERVER}}{{SCRIPTPATH}}/images/M204wiki_full.zip</code> || <code>M204wiki.full.xml</code> (all versions of each page) and <code>M204wiki_images.tar</code> (uploaded images and files) || Yes | |||
|} | |||
Neither file contains user records or security groups. | |||
'''M204wiki_current.zip is probably the copy you want''' if you only need to read the content. It is much smaller than the full version. It does not include the images; to get them, download the full zip and use only the images tar. The current file size is shown in your browser or by <code>ls -l</code> after download; sizes grow over time. | |||
Both files are refreshed every night, just after midnight Boston time. | |||
== Building a local copy with MediaWiki (Linux) == | |||
These steps load the {{SITENAME}} content into your own MediaWiki installation, which presents it in its original format. | |||
=== Requirements === | |||
* MediaWiki 1.43 or later ({{SITENAME}} runs 1.43.x) | |||
* PHP 8.1 or later, with the extensions MediaWiki requires (mbstring, xml, intl, curl, gd or imagick) | |||
* MariaDB or MySQL | |||
* A web server (Apache or nginx with PHP-FPM) | |||
* Disk space of several times the size of the zip, and a few GB for the database | |||
{{SITENAME}} uses no extensions that affect how pages display, so a standard MediaWiki installation is sufficient. No extensions are required. | |||
=== 1. Install MediaWiki === | |||
Follow [https://www.mediawiki.org/wiki/Manual:Installing_MediaWiki the MediaWiki installation guide] and complete the web installer. For the rest of these steps, MediaWiki is assumed to be in <code>/var/www/html</code>; substitute your own path. Run the commands below as the web server user (for example <code>sudo -u www-data</code>). | |||
== | === 2. Download and unpack === | ||
<p class="code"> | |||
cd /tmp | |||
curl -O https://m204wiki.rocketsoftware.com/images/M204wiki_current.zip | |||
unzip M204wiki_current.zip | |||
</p> | |||
=== 3. Import the pages === | |||
<p class="code"> | |||
cd /var/www/html | |||
php maintenance/run.php importDump --report=1000 /tmp/M204wiki.current.xml | |||
</p> | |||
Importing takes a while (the dump contains over 20,000 pages). Older MediaWiki releases use <code>php maintenance/importDump.php</code> instead of <code>run.php importDump</code>. | |||
<p class="code"> | === 4. Post-import steps === | ||
<p class="code"> | |||
php maintenance/run.php rebuildrecentchanges | |||
php maintenance/run.php initSiteStats --update | |||
</p> | |||
The links, categories and search index are filled in by MediaWiki's job queue. Run it to completion rather than waiting for page views to trigger it: | |||
<p class="code"> | |||
php maintenance/run.php runJobs | |||
</p> | |||
If page links or categories still look incomplete, run <code>php maintenance/run.php rebuildall</code>. | |||
=== 5. Import images (optional) === | |||
Download <code>M204wiki_full.zip</code>, and extract the images tar from it: | |||
<p class="code"> | |||
curl -O https://m204wiki.rocketsoftware.com/images/M204wiki_full.zip | |||
unzip M204wiki_full.zip M204wiki_images.tar | |||
mkdir /tmp/m204images | |||
tar -xf M204wiki_images.tar -C /tmp/m204images | |||
cd /var/www/html | |||
php maintenance/run.php importImages --search-recursively /tmp/m204images | |||
</p> | |||
<code>importImages</code> uploads each file through MediaWiki so that it is registered in the database. File uploads must be enabled by setting <code>$wgEnableUploads = true;</code> in <code>LocalSettings.php</code>. The image description pages themselves are included in the page dump. | |||
< | === 6. Logo and styling (optional) === | ||
The site-wide styling (<code>MediaWiki:Common.css</code>, <code>MediaWiki:Vector.css</code> and similar) is part of the page dump and is applied automatically on import. | |||
The logo is not part of the XML dump. Download it and point MediaWiki at it in <code>LocalSettings.php</code>: | |||
<p class="code"> | <p class="code"> | ||
curl -o /var/www/html/resources/assets/m204wiki-logo.png \ | |||
https://m204wiki.rocketsoftware.com/images/2/2d/Rocket-Logo_Horizontal_172x45.png | |||
</p> | </p> | ||
The | <p class="code"> | ||
$wgLogos = [ '1x' => "$wgResourceBasePath/resources/assets/m204wiki-logo.png" ]; | |||
</p> | |||
The logo is also included in the images tar in the full zip. | |||
=== Troubleshooting === | |||
* '''Import runs out of memory:''' raise <code>memory_limit</code> in the PHP CLI configuration (<code>php.ini</code>), or run with <code>php -d memory_limit=2G</code>. | |||
* '''Pages show raw template or table markup:''' the import has not finished, or the job queue is not run; repeat <code>runJobs</code>. | |||
* '''Images show as red links:''' step 5 was not done, or uploads are disabled. | |||
== Alternatives to a local MediaWiki installation == | |||
If you do not want to run a web server and database, you can use a program that reads the MediaWiki XML dump directly. A list of options is on [https://en.wikipedia.org/wiki/Wikipedia:Database_download Wikipedia's database download page]. These viewers do not support all MediaWiki features, so some pages may not display exactly as on {{SITENAME}}. | |||
== Updating local copies of {{SITENAME}} == | |||
The download and import process is a full refresh; no incremental option is offered. Changes you make to a local copy are lost if you import over it. To refresh, either start with an empty MediaWiki installation, or re-run step 3 over the existing one: pages that have changed are updated to the latest revision, but pages that have been deleted or renamed on {{SITENAME}} are not removed from your copy. | |||
If you would like to contribute to {{SITENAME}}, you will need to [[M204wiki:Get M204wiki User ID|obtain a M204wiki User ID]]. | |||
==See also== | == See also == | ||
* The Model 204 homepage: https://m204.rocketsoftware.com | |||
* [https://www.mediawiki.org/wiki/MediaWiki MediaWiki] | |||
* [https://www.mediawiki.org/wiki/Manual:Importing_XML_dumps Importing XML dumps] | |||
* [https://www.mediawiki.org/wiki/Manual:ImportImages.php Manual:importImages.php] | |||
* [https://www.mediawiki.org/wiki/Help:Export Help:Export (XML dump format)] | |||
Latest revision as of 16:47, 2 November 2026
The content of m204wiki is available for download, provided only that no copyright notices may be removed or altered. Each download is a zip archive containing an XML dump of the wiki pages, suitable for loading into your own installation of MediaWiki. The "full" archive also contains a tar file with all of the uploaded images and other objects such as PDF files.
How to download a copy of m204wiki
| File | Contents | Page history? |
|---|---|---|
https://m204wiki.rocketsoftware.com/images/M204wiki_current.zip |
M204wiki.current.xml: the latest version of each page |
No |
https://m204wiki.rocketsoftware.com/images/M204wiki_full.zip |
M204wiki.full.xml (all versions of each page) and M204wiki_images.tar (uploaded images and files) |
Yes |
Neither file contains user records or security groups.
M204wiki_current.zip is probably the copy you want if you only need to read the content. It is much smaller than the full version. It does not include the images; to get them, download the full zip and use only the images tar. The current file size is shown in your browser or by ls -l after download; sizes grow over time.
Both files are refreshed every night, just after midnight Boston time.
Building a local copy with MediaWiki (Linux)
These steps load the m204wiki content into your own MediaWiki installation, which presents it in its original format.
Requirements
- MediaWiki 1.43 or later (m204wiki runs 1.43.x)
- PHP 8.1 or later, with the extensions MediaWiki requires (mbstring, xml, intl, curl, gd or imagick)
- MariaDB or MySQL
- A web server (Apache or nginx with PHP-FPM)
- Disk space of several times the size of the zip, and a few GB for the database
m204wiki uses no extensions that affect how pages display, so a standard MediaWiki installation is sufficient. No extensions are required.
1. Install MediaWiki
Follow the MediaWiki installation guide and complete the web installer. For the rest of these steps, MediaWiki is assumed to be in /var/www/html; substitute your own path. Run the commands below as the web server user (for example sudo -u www-data).
2. Download and unpack
cd /tmp curl -O https://m204wiki.rocketsoftware.com/images/M204wiki_current.zip unzip M204wiki_current.zip
3. Import the pages
cd /var/www/html php maintenance/run.php importDump --report=1000 /tmp/M204wiki.current.xml
Importing takes a while (the dump contains over 20,000 pages). Older MediaWiki releases use php maintenance/importDump.php instead of run.php importDump.
4. Post-import steps
php maintenance/run.php rebuildrecentchanges php maintenance/run.php initSiteStats --update
The links, categories and search index are filled in by MediaWiki's job queue. Run it to completion rather than waiting for page views to trigger it:
php maintenance/run.php runJobs
If page links or categories still look incomplete, run php maintenance/run.php rebuildall.
5. Import images (optional)
Download M204wiki_full.zip, and extract the images tar from it:
curl -O https://m204wiki.rocketsoftware.com/images/M204wiki_full.zip unzip M204wiki_full.zip M204wiki_images.tar mkdir /tmp/m204images tar -xf M204wiki_images.tar -C /tmp/m204images cd /var/www/html php maintenance/run.php importImages --search-recursively /tmp/m204images
importImages uploads each file through MediaWiki so that it is registered in the database. File uploads must be enabled by setting $wgEnableUploads = true; in LocalSettings.php. The image description pages themselves are included in the page dump.
6. Logo and styling (optional)
The site-wide styling (MediaWiki:Common.css, MediaWiki:Vector.css and similar) is part of the page dump and is applied automatically on import.
The logo is not part of the XML dump. Download it and point MediaWiki at it in LocalSettings.php:
curl -o /var/www/html/resources/assets/m204wiki-logo.png \ https://m204wiki.rocketsoftware.com/images/2/2d/Rocket-Logo_Horizontal_172x45.png
$wgLogos = [ '1x' => "$wgResourceBasePath/resources/assets/m204wiki-logo.png" ];
The logo is also included in the images tar in the full zip.
Troubleshooting
- Import runs out of memory: raise
memory_limitin the PHP CLI configuration (php.ini), or run withphp -d memory_limit=2G. - Pages show raw template or table markup: the import has not finished, or the job queue is not run; repeat
runJobs. - Images show as red links: step 5 was not done, or uploads are disabled.
Alternatives to a local MediaWiki installation
If you do not want to run a web server and database, you can use a program that reads the MediaWiki XML dump directly. A list of options is on Wikipedia's database download page. These viewers do not support all MediaWiki features, so some pages may not display exactly as on m204wiki.
Updating local copies of m204wiki
The download and import process is a full refresh; no incremental option is offered. Changes you make to a local copy are lost if you import over it. To refresh, either start with an empty MediaWiki installation, or re-run step 3 over the existing one: pages that have changed are updated to the latest revision, but pages that have been deleted or renamed on m204wiki are not removed from your copy.
If you would like to contribute to m204wiki, you will need to obtain a M204wiki User ID.
See also
- The Model 204 homepage: https://m204.rocketsoftware.com
- MediaWiki
- Importing XML dumps
- Manual:importImages.php
- Help:Export (XML dump format)