Forbidden
You don't have permission to access / on this server.
Hmmm.
My first thought was what happened to the index.php file at the root of the site, perhaps renamed by accident or moved? I remoted into the server and looked in the www folder, and looked and looked...
Somehow, the entire www folder for the instance in question was gone. Oh boy.
The entire moodle server files location was gone.
My next thought was why hasn't anyone from their school district contacted me? How long has it been like this? Do I have a backup of the www or site files?My blood pressure was rising. I stayed calm and looked about my network space, hoping I had copied the www directory for emergencies like this. No go. I could go to our network people and request for a backup to be restored to a virtual server, where I could extract the missing directory and copy it back into place.
Before contacting the network police, I checked to see if there was a db instance, which there was. I checked to see if there was a data root folder, there was. I checked the apache vhost for the directive for the instance, check. All 3 other critical pieces were in place, the only thing missing was the moodle application files.
I thought, why not just copy one of the other instances, rename it and update the config.php? So I did, and updated these four variables with appropriate data.
$CFG->dbname
$CFG->wwwroot
$CFG->dirroot
$CFG->dataroot
The config.php file at the root of the moodle instance contains very critical information in 4 areas:
1. DATABASE SETUP
2. WEB SITE LOCATION
3. SERVER FILES LOCATION
4. DATA FILES LOCATION
After changing each of those to the appropriate value for my missing moodle instance, I bravely returned to my browser, hit refresh and....I was in. After logging in and looking around a little, the courses, users all seem to be in place. The only thing that is different is the theme that they had set, by copying the moodle code from another instance, I inherit their theme. Oh well, not too concerned about that.
Moral of the story?
- Back up your core moodle files, as well as your DB and courses.
- Don't panic
- Know what to change in the config.php file.
Another final note after cogitating on this a little longer. This is really overkill. As I am copying moodle server files into a backup location, 50 MB for 1.9. 84 MB for 2.x...do I really need to copy all this code code, that does not change, not much anyway. Maybe just copy the config.php file for each instance?
I'm not sure, I want to be thorough but drive space does have a cost too, not to mention my own sense that this is too much stuff to keep track of when I can get the core code from moodle.
It seems the data folder would be the wiser one to be backing up. That, you cannot get from the moodle site. But that is even MORE space to deal with. In our case, I shall rely on on network people in the event of lost data files.
This comment has been removed by the author.
ReplyDelete