[Mediawiki-l] Database Backup / Offline Mode

Alexis Moinet alexis.moinet at fpms.ac.be
Fri Jun 29 10:54:54 UTC 2007


Willem-Jan van Strien wrote :
> I've been browsing the MW website for a while looking for two pieces of 
> information. But I can't seem to find them.

http://lists.wikimedia.org/pipermail/mediawiki-l/2007-May/020358.html

> First of all, would there be any way to backup the database to a .--- file?
in a shell, type this :

mysqldump -u root -p --default-character-set=latin1 -d wikidb > '/the/path/you/want/backup.sql'

it will ask for your *mysql* root password (not the wiki sysop passwd)

I'm not sure you need to do it as root, you might give it a try simply with the mysql user you defined during install (default : wikiuser) --> it would be mysqldump -u wikiuser -p etc...

I *believe* it to be possible with phpmyadmin, but I'm *sure* that its *default* export options corrupt the database (e.g. it will mess with é è, ç, ù, ü,... chars)

> And would there be any way to import a similar .--- file into a fresh 
> database?

mysql -u root -p wikidb < '/the/path/you/want/backup.sql'

again, it will ask for your mysql root password

> Also, would it be possible to copy a wiki to a home computer so you 
> could work on it offline?

yes, simply you need a LAMP or WAMP (Linux/windows + apache-mysql-php) install, then import the backup using command above, then install mediawiki as usual (on your localhost of course).
If you give it the correct info during install, it will detect the already existing database and use it instead of creating a new one ;-)




More information about the MediaWiki-l mailing list