HOWTO backup & restore mediawiki
Posted on Wednesday 30 September 2009, 12:30 - Veille techno - Permalink Tweet
- Article
- |
- Comments(0)
- |
- Attachments(0)
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 :).
Prerequisites
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:
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.