Mediawiki maintenance: Difference between revisions
From wikinotes
(→Zim) |
|||
Line 124: | Line 124: | ||
== Zim == | == Zim == | ||
<blockquote> | <blockquote> | ||
{| class="wikitable" | |||
|- | |||
| [[wget-2-zim]] || bash script to scrape mediawiki to zimfile | |||
|- | |||
| [[mwoffliner]] || scrape a mediawiki to zimfile | |||
|- | |||
|} | |||
=== mwoffliner === | === mwoffliner === | ||
<blockquote> | <blockquote> |
Revision as of 13:44, 11 June 2022
Documentation
mediawiki static dump tools https://meta.wikimedia.org/wiki/Static_version_tools mediawiki dumpBackup xml https://www.mediawiki.org/wiki/Manual:DumpBackup.php
Backups
Full Backups
To create a full backup, you'll need to:
Backup Database
mysqldump -u wiki -pPASSWORD wikidb > ~/wikidb-backup.sqlBackup Images
TODO
Backup LocalSettings.php
TODO
Static HTML
TODO:
See if there are newer options for static html dumps.
See page of mediawiki parsers here: http://www.mediawiki.org/wiki/Alternative_parsers
wget
Captures/correct links, but not as relative links for me. technically can capture CSS too.
wget --recursive \ --page-requisites \ --adjust-extension \ --convert-links \ --no-parent \ -R "*Special*" \ -R "Special*" \ -R "*action=*" \ -R "*printable=*" \ -R "*oldid=*" \ -R "*title=Talk:*" \ -R "*limit=*" \ "https://yourwiki.com"mw2html
Install
# Install htmldata cd /home/will/dev # Install htmldata to a location on $PYTHONPATH curl -#O http://www.connellybarnes.com/code/htmldata/htmldata # Install mw2html cd $www/maintenance git clone https://github.com/samuell/mw2html.gitConfiguration
In order for the pythonscript to backup your wiki, it must have permission to read it. Confirm the following:# $WIKIROOT/LocalSettings.php $wgGroupPermissions['*']['read'] = true;Perform Backup
python2 mw2html.py \ http://127.0.0.1/index.php ~/mwexport \ -f --no-flatten --no-hack-skin --no-remove-pngstatic-wiki
A tool designed to create a static-html copy of wikipedia, preserving search.
github https://github.com/segfall/static-wiki static wikipedia http://static.wiki/ Zim
wget-2-zim bash script to scrape mediawiki to zimfile mwoffliner scrape a mediawiki to zimfile mwoffliner
See https://nuxx.net/blog/2020/06/23/archiving-mediawiki-with-mwoffliner-and-zimdump/
Delete Revision History
cd /usr/local/www/mediawiki/maintenance php deleteOldRevisions.php --delete