Moodle Database PROBLEMS

Moodle Database PROBLEMS

B Beals發表於
Number of replies: 8
I tried to upload a database from another site I was migrating, but I never told the site that I have it on any part of my server or now to read this new database and all the courses from that are now on the another of my moodle sites on the same hosting. I know that's kind of confusing so let me explain:

I have site (A) which is an old domain, which I'm currently in the process of moving to site (B) which, along with site (C) are on a different hosting. Site (C) now has the information from (A) once I uploaded the databases onto the hosting file manager and now I can't figure out how to undo that change, restore the old (C) database, and direct the (A) database to (B) and have a successful migration.

Hopefully that makes sense as now my question has kind of developed from an auto update (which makes sense why the database would tell moodle to format site C) to a database configuration error.
評比平均分數: -
In reply to B Beals

Re: Moodle Database PROBLEMS

Marc Grober發表於
Yes, your description is confusing..... let's see if we can simplify things.

An install anywhere is essentially composed of you moodle code directory, your moodledata directory and your sql database. Moving your moodle anywhere is simple enough in that you would need to copy moodledata, move the db, do a replace and edit the config.php file (see http://docs.moodle.org/en/Moodle_migration for details.)

You use replace.php to change appearances of one url in the database to another URL (you cxan actually use it to find and replace anything in the db, but be careful) and you edit config.php so that your moodle install is pointing to the correct locations for code, moodledata and db.

Of course this can get difficult if you have different version of Moodle you are fiddling about, but not overwhleming so....
In reply to Marc Grober

Re: Moodle Database PROBLEMS

B Beals發表於
Here's the problem:

I didn't actually change anything that would make that site view the other database.

I have site (A), which has all my courses and everything in it that I want to move to site (B). Site (B) AND (C) are both on the same hosting and that's where the connection between the two should stop. Site (A) is going to be shut down. I downloaded the old SQLdb in a .bz2 format and simply loaded it FTP to the new hosting file manager and did nothing to it.

I'm having trouble determining exactly what got changed and how on earth I'm supposed to get it back. Site (C) should never have had anything changed. I rechecked the config.php and it still shows that it is reading the database that I initially setup for it, but the site still shows all the courses from site (A); and when I click on any of the courses it gives me:

Course Module ID was incorrect

I have yet to change anything in config.php for (B) and am never going to for (C), and I haven't even loaded the moodledata folder yet either. This is why I'm so puzzled as to how I have all the courses showing on site (C) and none of the prior information.

What could have caused this and now how do I get things back? The most puzzling thing here is that I don't even have the site (A) sql file uploaded anywhere. How do I check settings and directions through phpMyAdmin? Since I can physically access the databases there, is there a chance something got screwed up when I was backing things up? Of course that question is too open ended by simply saying 'could something'; but if I never did anything changing where site (C) looks or change anything regarding it's databases, then nothing should be wrong, correct? As far as the information displayed there it shows all my databases for my moodle sites, (B) has and (198) next to it and (C) has (295) next to it (which I'm aware is the table content for the db) but it previously had about 198 as well since I had been doing everything for all my new sites at about the same pace.

Another question that I will have to address once I figure this out is where to place my moodledata files. In my public_html/moodledata directory there are multiple files that have been created but I'm not sure how to find out what goes where. The folder order in that directory goes 1, 3, cache, lang, sessions, temp, upgradelogs, user, and then has an .htaccess file.

I have the moodledata from the old site, but I don't know where I should put it to make it readable by (B) [and i'm not sure if anything I do will carry over to any other sites since I'm having this problem right now].

Now as far as your question regarding the versions and such; I have all sites at 1.9+, and the databases should all be compatible. That's not where I'm thinking that my problem is stemming from. And I also want to know how to use the replace.php once I get things going straight.
IN addition to not being able to direct my databases correctly, I'm still worried about the original database from site (C) which contained a completely seperate course setup and everything, and where I can (if possible) retrieve or correct that to.

Please let me know where I can start getting you any additional information, things I can start checking and relaying back, etc., because this is an extremely puzzling/frustrating issue and all help is greatly, GREATLY, appreciated!!

thanks,

Brett
In reply to B Beals

Re: Moodle Database PROBLEMS

Bob Puffer發表於
IMO you have a sufficiently complex problem warranting additonal, professional assistance... i.e., a Moodle Partner.

Barring that, a few steps you can begin to take are:
  1. Contact your hosting organization and find out about the sql backups for site C and determine how it can be restored to its original state
  2. Ask the hosting company how you might make sure moving the sql for site A will go to site B
  3. Move your moodledata folder over
  4. Make the necessary changes to config.php on site B to point to the new locations

In reply to Bob Puffer

Re: Moodle Database PROBLEMS

B Beals發表於
So I have the site B working just fine, and reading everything correctly from A. But all I did to do that was add a new moodledata folder in my moodledata directory and change the config.php to point to that location (uploading the old moodledata files to that new directory).

I haven't done anything with the SQL dump yet because I'm having problems uploading it through phpMyAdmin. I'm not sure where to put it so that the database is read correctly and everything, haven't done anything like that before.

I need some pointers on that if anyone has any!!

I had the guy from HostMonster try and do it but he said there were syntax errors from the SQL file that moodlerooms hosting gave me. So right now I'm confused as to what I'm missing from that SQL backup that I don't have on my site right now, because everything seeems to be reading correctly so far, and I have been able to access each course and its contained information.
In reply to B Beals

Re: Moodle Database PROBLEMS

Marc Grober發表於
While I don't know that I would recommend you see a Moodle partner (as it sounds like you are fleeing one already......) if you have not been able to resolve your problems with the info provided you may want to post a contract job in the database.

As far as phpmyadmin usage, if you have the db created and it is empty you need only import the file from your desktop as the app gives you the ability to save to and upload from a sql file (as long as its size does not exceed phpmyadmin's limits (which is another story.....)

Your descrip[tion, as I noted before is very confusing.... for example, you say site C already has the database but you want to undo it.... which doesn;t make any sense yo me, because you do want to move the sql file from host A to the host for B and C, and mysql does not care which db is pointed to by which moodle.

Perhaps the confusion comes over what you mean by uploaded and other actions you describe.....

we can;t of course assist you with corrupted sql files..... but the process as I initially described is pretty simple, and if you will break down the steps of exactly what you did and exactly what you now want to do it would be very helpful..... for example, saying you uploaded the db on to the host does not tell me specifically what you did.... did you just ftp a file to a remote host.... that is not going to populate the db.....

And, if your prior hoster provided you a sql dump, then, as I mention above, it is easy enough to use phpmyadmin to upload from your desktop. If you have already uploaded the file to the mysql host you may want to use the command line to import. This can be confusing where your mysql host is not your webhost (i.e. you may discover that you nuploaded the sql file to a host other than your mysql host....)

In reply to Marc Grober

Re: Moodle Database PROBLEMS

B Beals發表於
Couldn't import the sql file into the db (although it was empty) due to excessive upload size, and when I tried to have the hosting company do it they said that there was a syntax error and it couldn't be uploaded.

I guess I misspoke on what I meant by undoing everything to site C. Right now it has the courses listed as though they were all there, but when you click on them it says incorrect module id. I don't know where that site got the course list from because I've never changed annything on that site and that's what I want to undo.

As far as the confusion from terms and actions, I have two things from moodlerooms: the sql dump, and the moodledata folder. I created a directory for the moodledata, changed the config to read from there, and that's it. Now I can see all the courses on the site B but I get the same thing when trying to view them as I did in site C. Assuming I get a fresh sql dump, what's next?
In reply to B Beals

Re: Moodle Database PROBLEMS

B Beals發表於
I've essentially overcome this problem by going a different route... but I'd still like to have the forum feedback and input on the correct procedures here so that I myself, along with future moodlers, can have a correct reference on solving this issue.

thanks, as always, moodle community!