M204wiki:Database download

From m204wiki
(Redirected from SirWiki:Database Download)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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