Tech:Dumping a wiki

From Orain Meta
Jump to navigation Jump to search

This page describes the process of making XML dumps of wikis, and putting them online at Orain Static.

To make a dump

Run php5 /srv/mediawiki/w/maintenance/dumpBackup.php --current --wiki yourwikidb > /mnt/mediawiki/uploads/common/dumps/yourwiki/dump.xml (the directory where the dumps will be saved must already exist, if they don't, please run mkdir -p /mnt/mediawiki/uploads/common/dumps/yourwiki first)

Note using --full is resource intensive. Also change the name of the wiki as appropriate based on the database table name for the wiki you wish to dump.

To turn dump into compressed zip

zip /mnt/mediawiki/uploads/common/dumps/yourwiki/yourwiki<number of month>.zip /mnt/mediawiki/uploads/common/dumps/yourwiki/dump.xml

Note - This uses the zip file extension for compressing. Tar.gz is better but more intensive, and 7z has the best compression, but can be extremely resource intensive. Zip is preferred unless the XML dump is so big (depends but a rule of thumb is over 2GB), that max compression is required.

To remove the XML dump (after it has been compressed)

rm /mnt/mediawiki/uploads/common/dumps/yourwiki/dump.xml

Note - Unless there is a reason to keep the dump files around (such as needing extra backups/fallbacks besides SQL dumps for a server move), they should be removed immediately for space reasons.

To remove the zip

rm /mnt/mediawiki/uploads/common/dumps/yourwiki/insertdumpfilehere.zip

Note - Same as the uncompressed dump, these should be removed when no longer required to preserve server space.