Difference between revisions of "Wikibackup"
From Teknologisk videncenter
m |
m (→Restoring the database) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | == Backup of this wiki == | + | *Backup of /usr/local/www/mediawiki and /usr/local/etc/apache directories nessesary |
− | === Locking the database === | + | *Backup of Mysql database |
− | + | *backup of SphinxSearch engine setup (cron etc) | |
+ | == Backup of this wiki database == | ||
+ | === Locking the database === | ||
− | <pre> | + | During backup, the database will be locked using the [http://www.mediawiki.org/wiki/Manual:$wgReadOnly $wgReadOnly] variable in LocalSettings.php |
− | $wgReadOnly = 'Backup operation in progress. Please wait a few minutes.'; | + | <pre>$wgReadOnly = '<b>Backup operation in progress.</b> Please wait a few minutes.'; |
</pre> | </pre> | ||
+ | |||
=== mysqldump === | === mysqldump === | ||
example | example | ||
Line 11: | Line 14: | ||
mysqldump -u USERNAME -pPASSWORD --default-character-set=latin1 wikidb -c > /home/backup/wikidb120209.dump | mysqldump -u USERNAME -pPASSWORD --default-character-set=latin1 wikidb -c > /home/backup/wikidb120209.dump | ||
</pre> | </pre> | ||
+ | [[category:Database]][[category:mediawiki]] | ||
+ | == Restore of this wiki == | ||
+ | === Locking the database === | ||
+ | |||
+ | During restore, the database will be locked using the [http://www.mediawiki.org/wiki/Manual:$wgReadOnly $wgReadOnly] variable in LocalSettings.php | ||
+ | <pre>$wgReadOnly = '<b>Backup operation in progress.</b> Please wait a few minutes.'; | ||
+ | </pre> | ||
+ | === Restoring the database === | ||
+ | Consider dropping the database from mysql before restoring it | ||
+ | <pre> | ||
+ | mysql -u USER -pPASSWORD DATABASENAME < mysql.dump | ||
+ | </pre> | ||
+ | [[category:Mysql]] |
Latest revision as of 13:41, 4 June 2009
- Backup of /usr/local/www/mediawiki and /usr/local/etc/apache directories nessesary
- Backup of Mysql database
- backup of SphinxSearch engine setup (cron etc)
Contents
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