Backing and Restoring Mediawiki in Ubuntu
We are going to learn how to back up and restore our Mediawiki installed on a Ubuntu system.
To acomplish that we will execute some wiki maintenance commands.
These maintenance commands will be accesible after configuring AdminSettings.php file.
CONFIGURING AdminSettings.php FILE
AdminSettings.sample from the Mediawiki examples documentation will serve us as a model file to start.
We copy it into mediawiki configuration directory in /etc and assign the correct owner and permissions.
$sudo cp /usr/share/doc/mediawiki1.10/examples/AdminSettings.sample /etc/mediawiki1.10/AdminSettings.php
$sudo chown root:root /etc/mediawiki1.10/AdminSettings.php
$sudo chmod 600 /etc/mediawiki1.10/AdminSettings.php
Now we are going to edit AdminSettings.php file
$gksudo gedit /etc/mediawiki1.10/AdminSettings.php
Change these two variables using the parameters you used when creating the wiki database: e.g: wikiuser and its password.
$wgDBadminuser = 'DB user name'
$wgDBadminpassword = 'DB password'
Now that AdminSettings.php file is properly configured we are gonna back up and restore the wiki.
BACKING UP THE WIKI
dumpBackup.php command will back up our wiki:
$cd /var/lib/mediawiki1.10/maintenance
$sudo php dumpBackup.php --current > ~/foo_backup.xml
NOTE: --full option backups history of pages, not only last version as --current does.