Missing Moodle?

Missing Moodle?

by Ric Robinson -
Number of replies: 9

I setup Moodle 3.8 using a MySQL database.  It is hosted on a leased Linux server.   It passed all of the Server Environmental checks with flying colors.  All green OK's without any warning, errors, etc.   I have started to build a course and so far and everything seems to be working properly. 

However, I recently decided to do an upgrade to the most current build of Moodle 3.8 before I completed the creation of my first course.  I want to be absolutely certain that I understand, document, and am able to perform  backups and upgrades BEFORE making courses available in a production enviroment.

I use cPanel on the server which let's me access phpMyAdmin for database creation, updates, etc.  However, when I use phpMyAdmin to see what MySQL databases I have, there are only 2 listed.  One is information_schema and the other is trilearn_whm, which appears to be empty.  Neither db seems to contain Moodle data.  

According to the config.php the db name should be Moodle, but when I do a file search I can't find the Moodle db anywhere?   What am I doing wrong?
If  the Moodle db is missing wouldn't Moodle fail to work?  But Moodl is working?  So am I looking for the wrong db file or perhaps the db file is hidden?  Totally frustrating.

I am not an MySQL expert by any means.  I took a SQL course years ago and have worked with various types of databases years ago, so I do know a few db basics.  

Any insights would be GREATLY apprecaited!

Average of ratings: -
In reply to Ric Robinson

Re: Missing Moodle?

by Ken Task -
Picture of Particularly helpful Moodlers

The DB for moodle found in config.php file of your code drives your moodle.   Without the DB shown in config.php of code, your Moodle wouldn't work at all.   So it has to exist ... somewhere!!! smile

Interesting problem ... leased Linux servers come in many flavors ... and am wondering if your's on a shared service? or is it a dedicated server managed/unmanaged?  And it wouldn't hurt to mention where hosted/with what provider.  Providers usually have helpdesk as well as documentation/FAQ pages about their systems ... and that documentation/FAQ's ... maybe even a forum for customers ... might have info on phpmyadmin as well as any issues other customers have faced - hopefully with solutions.

One of the DB's you see in phpmyadmin ends with 'whm' ... which suggest Web Host Management ... a service typically offered customers on managed or unmanaged servers.  Rare to see a DB for WHM in MySQL me thinks.   Do you have more than one domain on your server?

If your DB server - also shown on a line in config.php file of code - is set to 'localhost' then the DB server should be on the same machine as the code.  IF localhost, one might find the DB files in /var/lib/mysql.  You should see a directory there by the same name as the DB name in config.php of code. But you cannot view them with any tool used to browse files ... just mentioned here so can verify DB are there.

Do you have more than one login to phpmyadmin?

in your cPanel, do you have a terminal icon?

'SoS', Ken

In reply to Ric Robinson

Re: Missing Moodle?

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
In my config.php, you will see that I have a dbname on line 10. When I go to phpMyAdmin, yes, I see this.

If you don't see this, I wonder if your server company is putting it elsewhere. Maybe they don't want you to be able to mess around with it?  The example that I am giving to you is a pretty common config.php. Maybe you can share yours (making privacy changes, of course.)

If the name trilearn_whm is your dbname, and since you see it in phpMyAdmin, how do you know that it is empty?  Might you provide a screenshot?
In reply to Ric Robinson

Re: Missing Moodle?

by Ric Robinson -
Thanks Ken and Rick for your ideas. I am using a shared VPS on BlueHost. So far I have had good support from them and Moodle has run well. I ended up going to their tech support and we resolved the issue with my not being able to see the moodle db in phpMyAdmin. For whatever reason, they were not able to give me access to the moodle db inside the File Manager tool, so I did an export within phpMyAdmin to serve as my database backup before updating to the newer Moodle build. Keeping my fingers crossed.
In reply to Ric Robinson

Re: Missing Moodle?

by Ken Task -
Picture of Particularly helpful Moodlers

Don't mean to burst bubble, but according to info below, there is no such thing as 'shared VPS on BlueHost'.   It's either shared (cheapo) or a VPS.

https://www.bluehost.com/blog/webhosting/shared-vs-vps-hosting-which-option-is-best-for-you-9300/

While a cheapo shared slice of a server might do in the beginning, if your plans for Moodle grow, you might be looking at migrating site to a VPS.

Just out of curiosity, have you visited your Moodle's -> Admin menu -> Server -> environment check and set drop down menu for version of Moodle to anything above 3.8 to see what the check says?

'SoS', Ken


Average of ratings: Useful (1)
In reply to Ken Task

Re: Missing Moodle?

by Ric Robinson -

Sorry, my bad.  I *was* on a shared server, but a few months ago migrated to VPS on Bluehost.   The Server Environment check in Moodle shows Moodle Version 3.8+  (Build 20191129) with all Service Check Status icons showing OK.

Thanks for the correction.


In reply to Ric Robinson

Re: Missing Moodle?

by Ken Task -
Picture of Particularly helpful Moodlers

Wasn't really trying to 'correct' ... more like warn!  Good to know you are on a VPS vs shared.   It would also make a diff in answering questions knowing that you are on a VPS and can 'control' a lot more things on the backend than you could on shared. smile

Command line extremely handy in many cases!

'SoS', Ken

In reply to Ric Robinson

Re: Missing Moodle?

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
Do you have backups of your Moodle before moving forward? Explain what kinds of backups you have.

You might need to be more active than just keeping your fingers crossed.

I am puzzled why you cannot use phpMyAdmin to see your Moodle database on your Bluehost VPS. But maybe I didn't understand your reply.

If you have a VPS, you should be able to install your own Moodle.  I don't understand what Bluehost is doing for you?  Are they running some kinds of "script" tool?
In reply to Rick Jerz

Re: Missing Moodle?

by Ric Robinson -
Per BlueHost, the phpMyAdmin issues were related to changes they made on their platform. They gave me a temp work-around by giving me moodle db access via my WHM root account. I continued working with BlueHost and now am able to access the moodle db via phpMyAdmin in my normal account. As to backups, I started using a daily automated backup service called Code Guard, which seems to be working correctly for backups, but I haven't tried to restore a backup from Code Guard yet. I set up Code Guard to backup the Moodle (MySQL) database, the Moodledata (files for all directories and subdirectories), and the Moodle software (files for all directories and subdirectories). It has been a interesting journey to get to this point, but I think I am ready now to go through the update process. I realize BlueHost's bread and butter is WordPress installs and maintenance and not Moodle. My main concern is that if I do a restore of the MySQL file that nothing changes in the db as the result of the restore. Since I don't have any students or complete courses built yet, I am able to do some experimenting to verify that the restore works.

You are right, having VPS, I was able to do the original install of Moodle. I had to learn how to set the MySQL and PHP to the correct versions, how to write the correct CRON statement. But after that everything seemed to work perfectly. : )

In reply to Ric Robinson

Re: Missing Moodle?

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
Great, it seems that you are just about there.

I recommend that you try to do a new install of a second moodle using your backup files. Seems like you know what you are doing.