Difference between revisions of "Backing up the wiki"

Jump to navigation Jump to search
Line 42: Line 42:
 
* [https://www.mediawiki.org/wiki/Manual:Robots.txt robots.txt] and [https://www.mediawiki.org/wiki/Manual:Short_URL short URLs]
 
* [https://www.mediawiki.org/wiki/Manual:Robots.txt robots.txt] and [https://www.mediawiki.org/wiki/Manual:Short_URL short URLs]
 
* add to .htaccess <code>Options -Indexes</code> and <code>Deny from</code> for all toxic IPs availble from [http://www.stopforumspam.com/ Stop Forum Spam]
 
* add to .htaccess <code>Options -Indexes</code> and <code>Deny from</code> for all toxic IPs availble from [http://www.stopforumspam.com/ Stop Forum Spam]
 +
* Rename folder w/mw-config
 
To be continued ...
 
To be continued ...
 
<!--  
 
<!--  

Revision as of 23:22, 3 September 2016

Backing up the wiki without server shell access, requires Python v2 (v3 doesn't yet work).

Run the the WikiTeam Python script dumpgenerator.py from the command-line to get an XML, with edit histories, dump and a dump of all images plus their descriptions.

A XML dump does not create a full backup of the wiki database, the dump does not contain user accounts, etc. Extensions and their configuration are also not backed up.

python dumpgenerator.py --api=http://www.sdiy.info/w/api.php --xml --images

Full instructions are at the WikiTeam tutorial.

Restoring from backup με λίγα λόγια

Assumes economical shared Linux hosting, with jailed shell access. Maybe out of date by now.

See MediaWiki.org for a more detailed explanation.

  • Use cPanel > MySQL to create db e.g. wiki, user e.g. root, grant all privileges to the user and set a password e.g. Whatever123
  • SSH into your server
  • cd public_html or whatever.
  • wget http://download.wikimedia.org/mediawiki/x.xx/mediawiki-x.xx.tar.gz (replacing x.xx as apropriate for current version).
  • tar -xpzf mediawiki-x.xx.tar.gz
  • mv mediawiki-x.xx/ w (don't put wiki pages in the root directory of the site)
  • Upload the XML dump and images folder to the server, to e.g. public_html/
  • Wget and extract Scribunto extension into the extensions folder, e.g. e.g. public_html/w/extensions.
  • Open your wiki with a web browser e.g. http://www.sdiy.info/w/
  • Follow theset up the wikilink. Complete the steps that follow. Leave most options at defaults. Except for:
    • Database character set select UTF-8.
    • Copyright and license to Creative Commons Attribution-ShareAlike
    • Extensions select at least Scribunto
    • Tick Enable file uploads
    • Tick Enable Instant Commons
  • Copy LocalSettings.php onto the server wiki folder, e.g. w/.
  • In the shell do php public_html/w/maintenance/importDump.php --dry-run < public_html/sdiyinfo_w-yyyymmdd-history.xml
  • If that works repeat without --dry-run
  • php public_html/w/maintenance/importImages.php public_html/images
  • php public_html/w/maintenance/rebuildrecentchanges.php

Take care to only delete files no longer required.

  • rm mediawiki*.tar.gz
  • rm sdiyinfo*.xml
  • rm w/extensions/Scribunto*.tar.gz
  • rm -fr images/

Further tweaks

To be continued ...