I'm trying to backup my MediaWiki instance. I'd like to do it completely, meaning that if the web server exploded suddenly, with the backup files, I can restore the MediaWiki instance completely to its state when the backup was created. The best reference so far I found is https://www.mediawiki.org/wiki/Fullsitebackup . Just want to check with experienced MediaWiki administrators if this is up-to-date and complete, or if it's even the best/right reference.
1 Answer
The fullsitebackup
script looks fine but it might not work on all systems. It's dumping the database and it's compressing the files in a tar file.
As with any backup script and system the best way to know if it works is to take the backup, set it up on a fresh machine and see if everything works as usual.
It's worth learning some basic shell scripting if you're managing websites for which you need to assure proper backups. I usually set up my backup systems with some shell code, with a little help from backupninja for the database dumps.
For MediaWiki systems it makes sense to "split up" the backup in different parts. I prefer to
- move code into
htdocs
orhtml
directory - keep code in a git repository at GitHub (excluding images and dumps),
- nightly dump database into a directory not accessible through webserver (e.g. Apache)
rsync
everything to somewhere else- I have a
scripts
directory to manage all this
I'm also running several MediaWiki instances from one code base. I might open up some of this code if there's enough interest (from me or others).
-
For running multiple MediaWiki instances, how to keep the sharable configuration choices synced across these instances? When making a change in LocalSettings.php, do you manually do the same change in LocalSettings.php for all the MW instances?– qazwsxCommented Sep 16, 2014 at 7:07
-
Shared stuff is the same, stuff that differs I keep in
$wgFarmVariables = array('1.example.com' => array( 'sharedUsers' => true), '2.example.com' => array('wgFarmSemantic' => true));
, which I then run throughif (array_key_exists(wiki_yt_host(), $wgFarmVariables)) { foreach ($wgFarmVariables[wiki_yt_host()] as $name => $value) { $$name = $value; } }
. (You're welcome to ask another question about this for follow up.)– theCommented Sep 16, 2014 at 7:31