Mediawiki maintenance: Difference between revisions
From wikinotes
Line 127: | Line 127: | ||
<blockquote> | <blockquote> | ||
See https://nuxx.net/blog/2020/06/23/archiving-mediawiki-with-mwoffliner-and-zimdump/ | See https://nuxx.net/blog/2020/06/23/archiving-mediawiki-with-mwoffliner-and-zimdump/ | ||
[[mwoffliner]] | |||
</blockquote><!-- mwoffliner --> | </blockquote><!-- mwoffliner --> | ||
</blockquote><!-- Zim --> | </blockquote><!-- Zim --> |
Revision as of 12:37, 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
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