Blog Pro de Jean-Baptiste HEREN

Notes d'un consultant Freelance en Informatique

To content | To menu | To search

HOWTO backup & restore mediawiki

The purpose of this post is an abstract procedure to backup and restore a Media Wiki install, Typically to move it from one server to another.

Notice that this process works with most of web applications. For Example, I am using the same kind of procedure to copy my oscommerce instance :).


To install the Wiki, we need:

  • an apache 2 Http daemon with PHP5 installed
  • Mysql 5 database server
  • Phpmyadmin to make it easier (optional)

For local installs, this can be done easily using an all-in-one tool:

  • WAMP on windows
  • for linux, don'have to explain :)

Backup Procedure

1- Backup the database :

  • by copying the mysql data/wikidb folder.
  • or by using the command line: mysqldump -p wikidb > sql_backup_file
  • or with phpmyadmin / export function.

2- Backup the web application

Save the www folder containing the mediawiki install and parameters (Specially /LocalSettings.php).

Restore Procedure

The restore process assumes the server is already up and running. And mysql has been set a root password.

1- Restore the database :

  • copy back the mysql wikidb folder to the mysql data folder.
  • or backup using the command line:  mysql -p wikidb < sql_backup_file
  • or with phpmyadmin / import function.

2- Create a wikidb user with all privileges to the wikidb database & Grant option.

This can be done with phpmyadmin (much easier)

Or you can do it with the mysql admin console:

# mysql --user=root mysql
#mysql> CREATE USER 'wikidb'@'localhost' IDENTIFIED BY 'PASSWORD';
#mysql> GRANT ALL PRIVILEGES ON wikidb.* TO 'wikidb'@'localhost'
     ->     WITH GRANT OPTION;

3- Restore the web application

Copy the /www contents to the apache server’s root folder

Adapt the /www/LocalSettings.php Database parametersto the new server.

Done !

Jean-Baptiste Heren

Author: Jean-Baptiste Heren

Stay in touch with the latest news and subscribe to the RSS Feed about this category

Comments are closed

no attachment

You Might Also Like

Partage de connexion iphone free mobile

Activer le mode modem sur Iphone 3G avec free mobile sous OSX

Pour activer le partage de connexion avec free sur iOS inférieur à 5, il faut se débrouiller tout seul. 1 - Télécharger la configuration opérateur free mobile chez apple...

Continue reading

automatic ftp tranfers on windows OS client using the command line

Here is a little trick we used on a recent project. We needed to automatize : (local <-- remote) download files from an ftp server specified folder (remote --> remote/subfolder) move the...

Continue reading