Difference between revisions of "Wikibackup"

From Teknologisk videncenter
Jump to: navigation, search
m (New page: == Backup of this wiki == === Locking the database === During backup, the database will be locked using the [http://www.mediawiki.org/wiki/Manual:$wgReadOnly $wgReadOnly] variable in Local...)
 
m (Restoring the database)
 
(5 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
During backup, the database will be locked using the [http://www.mediawiki.org/wiki/Manual:$wgReadOnly $wgReadOnly] variable in LocalSettings.php
+
*backup of SphinxSearch engine setup (cron etc)
 +
== Backup of this wiki database ==
 +
=== Locking the database ===
  
 +
During backup, the database will be locked using the [http://www.mediawiki.org/wiki/Manual:$wgReadOnly $wgReadOnly] variable in LocalSettings.php
 +
<pre>$wgReadOnly = '&lt;b&gt;Backup operation in progress.&lt;/b&gt; Please wait a few minutes.';
 +
</pre>
 +
 +
=== mysqldump ===
 +
example
 +
<pre>
 +
mysqldump -u USERNAME -pPASSWORD --default-character-set=latin1 wikidb -c > /home/backup/wikidb120209.dump
 +
</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 = '&lt;b&gt;Backup operation in progress.&lt;/b&gt; Please wait a few minutes.';
 +
</pre>
 +
=== Restoring the database ===
 +
Consider dropping the database from mysql before restoring it
 
<pre>
 
<pre>
$wgReadOnly = 'Backup operation in progress. Please wait a few minutes.';
+
mysql -u USER -pPASSWORD DATABASENAME <  mysql.dump
 
</pre>
 
</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)

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