M204wiki:Database download: Difference between revisions

From m204wiki
Jump to navigation Jump to search
Glw (talk | contribs)
No edit summary
Tom (talk | contribs)
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 download format is a zip archive that contains both an XML dump of the wiki pages suitable for loading into your own installation of Mediawiki (or one of the many personal wiki implementations) and a tar file with all of the uploaded images and other objects such as PDF files.
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}}==
Use one of the following URLs to download a copy of the {{SITENAME}} contents:
<p class="code">{{SERVER}}{{SCRIPTPATH}}/images/M204wiki_full.zip or
{{SERVER}}{{SCRIPTPATH}}/images/M204wiki_current.zip
</p>


'''M204wiki_full.zip''' contains the full {{SITENAME}} content (minus user records, security groups and "talk" pages), including all past versions of each page. As of September 2014, this file is approximately 104 megabytes of data, and expected to constantly increase in size.
{| 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) ==


'''M204wiki_current.zip''' contains only the latest version of each {{SITENAME}} page (minus user records, security groups and "talk" pages).  This copy provides the latest version of all material but ''without'' the page history.  As of September 2014, this file is approximately 46 megabytes in size, and it is expected to increase in size but to always remain smaller than the "full" version.  '''This is probably the copy you want.'''
These steps load the {{SITENAME}} content into your own MediaWiki installation, which presents it in its original format.


Both of the above files are refreshed every night, just after midnight Boston time.
=== 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


===Updating local copies of {{SITENAME}}===
{{SITENAME}} uses no extensions that affect how pages display, so a standard MediaWiki installation is sufficient. No extensions are required.
If you make changes to a downloaded copy of the {{SITENAME}} content, then of course those changes will be lost if you refresh the downloaded copy; The download and import process is a full refresh, and no incremental option is currently offered.


If you'd like to contribute to {{SITENAME}}, you will need to [[M204wiki:Get M204wiki User ID|obtain a M204wiki User ID]].
=== 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>).


==What to do with your copy of {{SITENAME}}==
=== 2. Download and unpack ===
Most likely you are downloading a copy of {{SITENAME}} because your <var class="product">Model&nbsp;204</var> site does not allow internet access.  Maintaining a local copy of {{SITENAME}} provides access in a format that can be kept as up-to-date as you like.
<p class="code">
cd /tmp
curl -O https://m204wiki.rocketsoftware.com/images/M204wiki_current.zip
unzip M204wiki_current.zip
</p>


If you want to present {{SITENAME}} totally faithful to its original format, you'll want to install a local copy of Mediawiki, the software currently hosting {{SITENAME}}:
=== 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">http://www.mediawiki.org/wiki/MediaWiki</p>
=== 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>.


There are a variety of methods for importing a {{SITENAME}} XML dump and related binary uploads, all explained at the Mediawiki site:
=== 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.


<p class="code">http://www.mediawiki.org/wiki/Manual:Importing_XML_dumps</p>
=== 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.


Once you have a copy of Mediawiki installed, the simplest way to load the M204wiki content in a single step is via the script in <code>maintenance/importDump.php</code> (documentation provided in "Using importDump.php, if you have shell access" at the above link). For example, issue a command like the following (this is the file which was downloaded on September 10, 2014):
The logo is not part of the XML dump. Download it and point MediaWiki at it in <code>LocalSettings.php</code>:
<p class="code">php \www\mediawiki\maintenance\importDump.php c:\users\dave\downloads\XC140910.xml
<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 above command can be run in Windows, if the MoWeS portable reader was installed in the root directory containing <code>\www</code> and the current M204wiki was saved in the above <code>downloads</code> directory.
<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}}.


Alternately, you can forgo the local installation of Mediawiki and use one of the aftermarket readers designed to import and display the Mediawiki XML dump.  The most popular one is Wikitaxi (Windows only; no Linux or OS/X version is provided):
== Updating local copies of {{SITENAME}} ==


<p class="code">http://en.wikipedia.org/wiki/Wikipedia:Database_download#WikiTaxi</p>
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.


A number of other viewing options are explained at the above page.
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 ==
<ul>
* The Model 204 homepage: https://m204.rocketsoftware.com
<li>The Model 204 homepage: http://model204.rocket-software.com
* [https://www.mediawiki.org/wiki/MediaWiki MediaWiki]
<li>Mediawiki: http://www.mediawiki.org<
* [https://www.mediawiki.org/wiki/Manual:Importing_XML_dumps Importing XML dumps]
<li>Wikitaxi: http://www.wikitaxi.org
* [https://www.mediawiki.org/wiki/Manual:ImportImages.php Manual:importImages.php]
<li>Wikimedia XML dump importing: http://www.mediawiki.org/wiki/Manual:Importing_XML_dumps
* [https://www.mediawiki.org/wiki/Help:Export Help:Export (XML dump format)]
<li>Mediawiki XML dump format: http://meta.wikimedia.org/wiki/Help:Export
<li>Wikipedia's information page on using XML database dumps: http://en.wikipedia.org/wiki/Wikipedia:Database_download
</ul>

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_limit in the PHP CLI configuration (php.ini), or run with php -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