How to extract questions & answers from moodle servers?

How to extract questions & answers from moodle servers?

by farrukh baig -
Number of replies: 1

Our moodle server somehow had problem and user cannot access it with follwoing error message Error: Database connection failed

It is possible that the database is overloaded or otherwise not running properly.

The site administrator should also check that the database details have been correctly specified in config.php


While we try to resolve it, in the meantime we want to extract the question and answers from moodle server (which we can access) so that we can copy the same to the new installation for students to access it.


Please advise if we can do it? and how?

Regards.


Farrukh

Average of ratings: -
In reply to farrukh baig

Re: How to extract questions & answers from moodle servers?

by Colin Fraser -
Picture of Documentation writers Picture of Testers

First off: 

The site administrator should also check that the database details have been correctly specified in config.php

Have you checked the config.php file to make sure the database is properly named and accurately mapped? Do that first. Also, has the database had a name change or been deleted or something? Has the config.php been moved? 

Second: If you have phpMyAdmin on yourserver or the Moodle Adminer plugin, you can search your database using the UI for that tool and perform any SQL operation you may chose. You can search for, then extract whatever data you require, or backup any group of tables and restore them to the new database, although that is not necessarily a good option. Check to make sure the tables in both Moodles are the same. 

As a wild speculation:  The only times I have ever seen this error is on installation of a new Moodle - and one other time. In that case a person who should have known better, (not me, really,)thought he was dropping several unused or obsolete databases. He picked the wrong one. That was a very difficult two days I can tell you...