Lift and shift moodle

Lift and shift moodle

by Adam Cripps -
Number of replies: 4

$version  = 2016052300.04;

I'm having a problem moving a moodle (I think it's version 3.1). I have moved all the moodle code files over and have created a mysqldump with mysqldump -u root -p MyMoodle > mymoodle.sql and then importing with mysql -u user -p MyMoodle < mymoodle.sql.

Everything seems to work perfectly (no errors), until I browse the moodle site - I then get:


Table "sessions" does not exist
Debug info:
Error code: ddltablenotexist
Stack trace:
  • line 621 of /lib/dml/moodle_database.php: dml_exception thrown
  • line 1477 of /lib/dml/moodle_database.php: call to moodle_database->where_clause()
  • line 289 of /lib/classes/session/manager.php: call to moodle_database->get_record()
  • line 82 of /lib/classes/session/manager.php: call to core\session\manager::initialise_user_session()
  • line 782 of /lib/setup.php: call to core\session\manager::start()
  • line 34 of /config.php: call to require_once()
However, when I do a show tables on each database (the original and the copy) they both have 333 tables.
  • line 30 of /index.php: call to require_once()
What could be going wrong here?
Average of ratings: -
In reply to Adam Cripps

Re: Lift and shift moodle

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Is the $CFG->prefix setting the same in both config.php?

In reply to Adam Cripps

Re: Lift and shift moodle

by Ken Task -
Picture of Particularly helpful Moodlers

Line 30 of index.php is:

require_once('config.php');

What are ownerships/permissions on config.php?

Moving/migrating a site probably done as root user ... sometimes getting files into place as root also tags files as belonging to the root user.

It's ok that config.php file is owned by root ... but permisisons are key ... user underwhich web service runs must be able to 'read' config.php.   So depending upon how paranoid one is, config.php could belong to root user and group, but *all others* have to be able to at least read the file.

If can't read config.php then it would follow all the DB settings in that file cannot also not be read ... could lead to some strange behavior.

'spirit of sharing', Ken