Migrating Moodle 1.9.7

Migrating Moodle 1.9.7

by David Maldonado -
Number of replies: 5

Good Afternoon,

I don't know what I am doing wrong. I am migrating Moodle from my windows to linux servers in my test environment. And everything migrates apparently, except my user accounts. I cannot login to moodle after I migrate my site.  These are the steps I am following:


 1. Install moodle in the new server, place site in maintenance mode, then stop apache

 2. Place your current (windows) moodle server in maintenance mode

 3. Make a copy of Moodle and MoodleData folders

 4. Backup your databse (mysqldump --opt -u root -p moodle > c:\moodledbbackup)

 5. In the new server, move the clean moodle and moodledata folder to a safe spot

 6. Replace the moodle, moodle data folders with the copy from the windows server

 7. Change permissions on the new moodle data folder for apache to be able to access

 8. modify config.php to point to my folders in linux

 9. Restore Database (mysql -u root -p moodle < moodledbbackup)

10. start apache

11. Go to my moodle site, and it is there, but I cannot login with any of the accounts from the windows server, or the account I setup with I first installed moodle in windows...


Any advice would be greatly appreciated.


Thanks!
DM

Average of ratings: -
In reply to David Maldonado

Re: Migrating Moodle 1.9.7

by Ken Task -
Picture of Particularly helpful Moodlers

Sounds like you are on a remotely hosted system which has a 'clickable' installer for Moodle and you've run through that once to see the DB server, paths, etc..   That might be the only reason to install a Moodle on new server prior to migrating a site from another server (any platform).

Did you drop all tables in the DB for the fresh install of Moodle ... and then import the SQL dump?  OR did you just import the SQL dump into the DB?

Got any tool on your Linux server that allows you to look at tables ... mdl_user especially.

In the config.php file for the old Windows version, is there a line for 'password salt'?   If there is, copy that line to your linux server's config.php file.   While the site resided on Windows, there is a good chance one was using LDAP for authentication.   Could it be that at one point and time *all* users in mdl_users table were set to use LDAP authentication for logging on?

Using the config-dist.php file, locate the lines that turn on debugging via config.php file and add them to the config.php file on the Linux server.   No need to restart services, just attempt to login and let's see if there are errors of some sort.

Also, if there are errors, apache should be running an error log.   Depending upon your flavor of Linux and if it's a shared system, that log file might give hints/clues as to what is NOT working.

'spirit of sharing', Ken


In reply to David Maldonado

Re: Migrating Moodle 1.9.7

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Step 1 is unneccesary. Otherwise it looks OK. You can compare against https://docs.moodle.org/19/en/Moodle_migration.

All the typical causes of not being able to login Ken has mentioned. The fastest way of finding out is by activating https://docs.moodle.org/19/en/Debugging.
In reply to Visvanath Ratnaweera

Re: Migrating Moodle 1.9.7

by David Maldonado -

Thanks Visvanath,


Like I was telling Ken, what are the correct permissions to set on my real moodle site so that I don't open it to the world? Doing the chmod to 777 did the trick for me, but I don't want to do that on my real server...


Kind Thanks!

DM

In reply to David Maldonado

Re: Migrating Moodle 1.9.7

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
It is essential that the owner of the web server processes has read and write privileges in $moodledata. Giving it 0777 doesn't mean that the files are open to the world since $moodledata lies outside the web root. Still, if you are paranoid follow https://docs.moodle.org/en/Security_recommendations#Most_secure.2Fparanoid_file_permissions.