Backing up the wiki: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
No edit summary
No edit summary
Line 1: Line 1:
== Mediawiki Dump Generator ==
== Mediawiki Dump Generator ==
You can easily generate a database dump and file dump using the Mediawiki Client Tools' [[github:mediawiki-client-tools/mediawiki-dump-generator|Mediawiki Dump Generator]] Python 3 dumpgenerator script, (full instructions are at this link).
You can easily generate a database dump and file dump using the Mediawiki Client Tools' [https://github.com/mediawiki-client-tools/mediawiki-dump-generator Mediawiki Dump Generator] Python 3 dumpgenerator script, (full instructions are at this link). The result will include an XML dump with full page history, a dump of all images and files along with associated descriptions and a siteinfo.json file containing information about features, such as the installed extensions and skins.


e.g. <code><nowiki>dumpgenerator --xml --xmlrevisions --images --delay 0.0 https://SUBDOMAIN.miraheze.org</nowiki></code>
The result will include an XML dump with full page history, a dump of all images and files along with associated descriptions and a siteinfo.json file containing information about features, such as the installed extensions and skins.


To dump a private wiki you will have to use a login that has at least read permission on the wiki.
To dump a private wiki you will have to use a login that has at least read permission on the wiki.


e.g. <code><nowiki>dumpgenerator --xml --xmlrevisions --images https://SUBDOMAIN.miraheze.org --user USER --pass PASSWORD</nowiki></code>
== Restoring from backup ==<!-- untested -->
''See [https://www.mediawiki.org/wiki/MediaWiki MediaWiki.org] for more detailed instructions, (specifically [https://www.mediawiki.org/wiki/Manual:Importing_XML_dumps Manual:Importing XML dumps]'' and ''[https://www.mediawiki.org/wiki/Manual:ImportImages.php Manual:importImages.php]).''


== Restoring from backup ==
After installing MediaWiki and extensions, in the shell use importDump.php to import the XML, this can take a long time. e.g. from the mediawiki folder<br /><code>php maintenance/importDump.php --conf LocalSettings.php --dry-run < ''your_dumpfile.xml''</code>
''See [https://www.mediawiki.org/wiki/MediaWiki MediaWiki.org], specifically [https://www.mediawiki.org/wiki/Manual:Importing_XML_dumps Manual:Importing XML dumps]'' and ''[https://www.mediawiki.org/wiki/Manual:ImportImages.php Manual:importImages.php].''

If that works repeat without --dry-run. It won't matter if the XML dump file has the file extension .gz or .bz2 (is compressed).

Due to the bug [https://phabricator.wikimedia.org/T206683 T206683] it may be necessary to also include <code>--user-prefix=""</code> in the command.

Afterwards use ImportImages.php to import the images<br /><code>php maintenance/importImages.php ''your_files''/</code>

Afterwards run <code>php maintenance/rebuildrecentchanges.php</code> in order to update the content of Special:Recentchanges.


== External links ==
== External links ==

Revision as of 12:20, 10 June 2024

Mediawiki Dump Generator

You can easily generate a database dump and file dump using the Mediawiki Client Tools' Mediawiki Dump Generator Python 3 dumpgenerator script, (full instructions are at this link). The result will include an XML dump with full page history, a dump of all images and files along with associated descriptions and a siteinfo.json file containing information about features, such as the installed extensions and skins.

e.g. dumpgenerator --xml --xmlrevisions --images --delay 0.0 https://SUBDOMAIN.miraheze.org

To dump a private wiki you will have to use a login that has at least read permission on the wiki.

e.g. dumpgenerator --xml --xmlrevisions --images https://SUBDOMAIN.miraheze.org --user USER --pass PASSWORD

Restoring from backup

See MediaWiki.org, specifically Manual:Importing XML dumps and Manual:importImages.php.

External links