Wikibackup

From Teknologisk videncenter
Revision as of 13:41, 4 June 2009 by Heth (talk | contribs) (Restoring the database)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
  • Backup of /usr/local/www/mediawiki and /usr/local/etc/apache directories nessesary
  • Backup of Mysql database
  • backup of SphinxSearch engine setup (cron etc)

Backup of this wiki database

Locking the database

During backup, the database will be locked using the $wgReadOnly variable in LocalSettings.php

$wgReadOnly = '<b>Backup operation in progress.</b> Please wait a few minutes.';

mysqldump

example

mysqldump -u USERNAME -pPASSWORD --default-character-set=latin1 wikidb -c > /home/backup/wikidb120209.dump

Restore of this wiki

Locking the database

During restore, the database will be locked using the $wgReadOnly variable in LocalSettings.php

$wgReadOnly = '<b>Backup operation in progress.</b> Please wait a few minutes.';

Restoring the database

Consider dropping the database from mysql before restoring it

mysql -u USER -pPASSWORD DATABASENAME <  mysql.dump