On Fri, 30 May 2008 11:18:49 +1200
Roger Searle <[EMAIL PROTECTED]> wrote:

> Hi, I have a HH machine running in vmware that has mediawiki freshly 
> installed and configured, I can browse to the main page of the wiki and 
> could begin creating articles etc.  I have a mysql backup of a wiki that 
> I had previously when running Gutsy (which broke on upgrading to 
> Hardy).  I created this using the mysql administrator tool - creates a 
> .sql dump file that I am now wanting to restore and replace the database 
> of the freshly installed wiki. 
> 
> I can use the MySQL Administrator tool's Restore Backup function to do a 
> restore, however I am lost at the point of understanding where this 
> restored database has gone, but more importantly how to replace the 
> database of the freshly installed wiki and therefore see the previously 
> created articles.  Any pointers on where to look or how to go about such 
> a process would be greatly appreciated. 
> 
> Cheers,
> Roger

** Note: this is only guaranteed to work if the version of mediawiki has not 
changed **

The sql dump is a text file ( unless it's been zipped up in some way ), so you 
can look at what has been written. This is important, as the dump can 
optionally add code to select the database, replace the tables, etc. 

I'm running a fairly old version of mediawiki, so this may have changed, but... 
database details are held in LocalSettings.php in the root of the website: 
$wgDBname, user, password, server. Take a note of these so you know what to 
populate.


Assuming the dumpfile doesn't create the database, then you need to... ( 
replacing dbname, user, password with the above values ).

make a backp of the current database.
mysqldump -u user -p dbname > mediawikibackup.sql
( enter password when prompted )

login to the mysql database 
mysql-u user -p
( enter password when prompted )
mysql> drop database dbname;
mysql> create database dbname;
mysql> \q

( don't bother creating the database if there's a line in the sql dump to do so 
).

repopulate the database
mysql -u user -p dbname < theoldbackup.sql
( enter password when prompted )

This is the hardcore way of doing it, and no matter the front end that's in 
use, these are the steps that are necessary. 


hth,

Steve

Attachment: pgpLO7fznd2N6.pgp
Description: PGP signature

Reply via email to