User:Flominator/Backup MW

The following combination of scripts I used in order to backup a MediaWiki from a linux machine and to copy it to a windows machine running XAMPP. Feel free to copy them and put them into the root folder of your MediaWiki installation (where your LocalSettings.php is stored as well).

backup.sh
This file packs a database dump, the contents of the folders images and extensions and LocalSettings.php into a zip file name with today's date.

Bonus (not required): Keep only five backup files and delete the rest

backup.php
This file creates a backup using backup.sh and enables the user to download the backup via http.

import.bat
This file is used to import the wiki at the windows machine. Just drag the file downloaded from backup.php on a link to import.bat or start it with import FILENAME. You also need the tool unzip.exe from http://www.info-zip.org/UnZip.html for this. Warning: Make sure that there are no other ZIP or SQL files within the root directory of the wiki

If you have broken imagelinks, and are not able to create thumbnails afterwards, simply edit LocalSettings.php and enable $wgHashedUploadDirectory: