More complete guide to backup/restore?

More complete guide to backup/restore?

by The Tinman -
Number of replies: 1

I'm running Moodle on Windows, using the self installing kit 1.9 (from http://download.moodle.org/windows/).  Since I'm not very experienced in db admin, I've setup a second computer to work out the details of backing up and restoring.

On the real server, I've backed up the sql database to a file and transferred the file to my backup server.

I ran the same installer on the backup test server, and then went to Server->Database-> and tried to import my database backup using the import function.  The instructions on this page (http://docs.moodle.org/en/Site_restore) make it seem super easy, but I feel like I'm not even looking at the same program they're describing..

  1. Open the database to restore
  2. Click the SQL tab.
  3. On the "SQL"-page , unclick the show query here again.
  4. Browse to your backup of the database.
  5. Click Go

when I go to Server -> Database the first screen I see says Localhost at the top.  I click on Databases and see a database called Moodle.  I then click on the sql tab, I then uncheck show this query here again.  On this tab, there is no where to browse to a backup.  I only see an option to run queries against server "localhost".  where am I supposed to browse?

I assume I need to import, so I go to Import.  Here I browse to my backup file and then press GO.   I get an error saying "moodle" database already exists.

I wiped out everything, and did it all again.  This time when creating the db during install, I named it Moodle2, hoping I could restore my original moodle db and then change the db being used in config.php to use moodle instead of moodle2.

When I did that I get a message saying ERROR: Database Connection Failed. and it directs me to inspect config.php

has anyone assembled a more complete step-by-step dummy guide to backup and restore?  I'm not a complete idiot, and have done this sort of thing a little in the past.  But the last time I built a similiar server to do something like it, it ended up taking me 2 or 3 weeks because all the instructions on how to do everything was so segmented.  You want to configure email, click here, you want this, click here, you want that, click here.  So I spent a lot of time jumping back and forth and giving myself a headache.  If I can avoid that this time....I'd certainlly like to.

Average of ratings: -
In reply to The Tinman

Re: More complete guide to backup/restore?

by The Tinman -

My problem was that my backup file used INSERT instead of REPLACE.


Here's my procedure for manual backups (for now at least, until I get more familiar with the process).

Moodle eLearning Backup Procedure

I. Backup the SQL Database

1. Log into http://elearning.domain.local (192.168.1.14) as Administrator, password is *****.

2. On the left menu, under Site Administration, click Server, then Database.

3. On the left side of the screen, click the word Moodle (which is the name of the database).

4. On the right side of the screen, click on the tab Export.

5. Check the following settings, then click Go.

    1. Export should include all the tables.
    2. Data export type should be changed from Insert to Replace.
    3. Check the box next to Save as file.

6. When clicking Go, you should be prompted to save a file which is automatically named Moodle.sql.  Click ok to save the file to a backup destination.


II. Backup additional files

  1. Save contents of \\elearning\c$\Documents and Settings\administrator\Desktop\server\moodledata and \\elearning\c$\Documents and Settings\administrator\Desktop\server\moodle to backup destination.
  2. .\Server\moodle files are system files, and may not need to be backed up each time (will need to test to verify).

III. Recovery

  1. Create a fresh install of Windows XP and assign it a static address of 192.168.1.14, and the hostname eLearning.  Remove the old entry for eLearning from active directory, and then join the new server to the domain.
  2. Log into the computer as Domain administrator, and unzip the contents of MoodleWindowInstaller-latest-19.zip to the desktop.  Doubleclick Start Moodle to install Moodle related software on this new server.
  3. Open web browser and go to 127.0.0.1, follow the onscreen prompts to install Moodle using unattended installation.  Details you provide for site name, admin password, etc are irrelevant at this point because our backup will over write them.
  4. Once moodle is installed , log into 127.0.0.1 using the admin login and password you used during setup.
  5. On the left menu, under Site Administration, click Server, then Database.  You will be prompted to click ok at the bottom to install the PhpMyAdmin files for their first use.
  6. On the left side of the screen, click the word Moodle (which is the name of the database).
  7. On the right side of the screen, click on the tab Import.
  8. Browse to the location of your backed up Moodle.sql file, then click ok.
  9. From the desktop, Stop Moodle, and copy the Moodledata and Moodle folders from the backup destination to C:\Documents and settings\Administrator\Desktop\Server\ directory.
  10. Restart Moodle.