[Mediawiki-l] MYISAM or InnoDB best for Mediawiki?

Ian Smith ismith at good.com
Mon Apr 16 15:51:43 UTC 2007


Frames Project wrote:
>
> I copied the whole mysql directory, manually. A practice i used for
> years, because mysqldump is very lunatic.

If you shut down the mysql server before copying the directory, that
could work.  Otherwise, you're backing up MySQL's internal data
structures as they're changing, which guarantees an inconsistent backup
(if someone happens to edit a page during the copy).  If it's worked to
date, that's just by luck.

What is wrong with mysqldump?

* It is the recommended backup procedure (at least one of them)

* it does the job correctly (not copying changing internal data
structures, but making a consistent SQL snapshot)

* it works very well for me -- I've used it to clone my wiki quite a few
times with no problems (just watch out for character encoding issues;
see http://www.mediawiki.org/wiki/Manual:Backing_up_a_wiki)

Here's the backup command I use:

	mysqldump -u root -pfoobar --lock-tables		\
				--add-drop-database
--skip-extended-insert
				-r "$sqlfile" --databases wikidb

This command locks the database for write to guarantee a consistent
backup.  The wiki works as normal during the backup, except that someone
trying to save an edit will be blocked until the backup is done.  On my
wiki, with about 100 meg of data, it takes 11 seconds.

Ian



More information about the MediaWiki-l mailing list