Simple advice

Simple advice

by Jay G. -
Number of replies: 1
Hi, I've been chipping away at getting our moodle version upgraded. I shan't go into the comedy of errors it turned out to be :/ but I think I am at the last hurdle.

I backed up before we moved over. We did MySQL from v4.x to v5 at the same time, and now I think I just need to restore backup. But this is proving less than intuative... I don't actually know where to start! the FAQ covers backups but not restoring as far as I can see....
Average of ratings: -
In reply to Jay G.

Re: Simple advice

by Iñaki Arenaza -
iTaba kei {Sa} iTaba kei {Sa} iTaba kei {Sa} iTaba kei {Sa} iTaba kei {Sa}
If you did a database backup (with mysqldump or similar tools), doing a restore is quite simple. You just feed the file into mysql command, and it restores the contents directly (a mysql backup is just a series of commands to create the tables and insert the values, in plain SQL syntax).

Say you have your backup in a file called moodle.dump, that your moodle database is called 'moodledb', that you use a username 'moodleuser' with password 'moodlepass' to connect to that database, you just need to drop all of the existing tables (or the restore will add to the existing contents), and then execute:

    mysql -u moodleuser -p moodledb < moodle.dump

and then type the 'moodlepass' password when you are prompted to.

Saludos. Iñaki.