localhost backup problem

localhost backup problem

by Sofia Rehan Ramli -
Number of replies: 11

Hi,

I have Moodle 3.3 installed on my desktop (localhost). I am trying to install the same Moodle on my laptop (same Moodle version). I copied both 'moodledata' and 'mysql' folder from my desktop to the laptop. From the front page, it looks like it is successfully migrated. However I could not get past the login page. After inserting the username and password, I am stuck at localhost/login/index.php showing a blank page. 


Any help is greatly appreciated. Thank you.

Average of ratings: -
In reply to Sofia Rehan Ramli

Re: localhost backup problem

by Colin Fraser -
Picture of Documentation writers Picture of Testers

The usual issue is that the $CFG->wwwroot = 'localhost'; is pointed to something different. It could be $CFG->wwwroot   = '127.0.0.1'; when it should be something like $CFG->wwwroot   = 'http://localhost/moodle'; Just as frequently though, what has happened is that the database and moodledata folder may have been copied over correctly, but not necessarily migrated properly. Try this Moodle Doc on Migrating a Moodle. This should provide more up to date information on what might have happened.  

In reply to Sofia Rehan Ramli

Re: localhost backup problem

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

It appears to me from what you describe is that you have had success with copying and installing everything to your laptop, you just cannot log in.

In the past, this has occasionally happened to me.  I am not sure why.  The way that I fix this is to manually change my password in the MySQL database.  Usually, I use a helper tool, phpMyAdmin.  I think users passwords are in the {prefix_}users table.  You won't see the actual passwords, they are encrypted.  But I have had success changing my own (I am the administrator) password.  Somehow, I think I have also tried setting the value for "ForcePasswordChange" to yes, or something like that.

Of course, on your local install, you have full control of everything.

In reply to Rick Jerz

Re: localhost backup problem

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Haven't heard that one Rick, but sounds good. Whenever I have done that though, I have copied the Guest password directly into the Admin's password field, again using phpMyAdmin. The hash encryption is already in place and the password "Guest" gets you in, so you change it back or to something else immediately.  

In reply to Colin Fraser

Re: localhost backup problem

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

From my notes, I have successfully used: "If using phpmyadmin, select the password 'Function' as MD5 and then enter your password."

So it is a little more complex than what I stated.

Here are some other items from my notes about changing passwords.  One of these might also work.

From SSH: cd /pathtomoodle/moodle/admin/cli/, php reset_password.php

In reply to Rick Jerz

Re: localhost backup problem

by Sofia Rehan Ramli -

Ok, this may seem like a dumb question, but should I download phpmyadmin first? Then where should I put that folder?

I opened XAMPP Control Panel, and clicked the Admin button of MySQL. It redirects me to localhost/phpmyadmin, but I get the error 'Object not found'. I have no problem accessing the site when I am not logged in (Guest).

In reply to Sofia Rehan Ramli

Re: localhost backup problem

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

XAMPP typically supplies phpMyAdmin.  If phpMyAdmin doesn't work, XAMPP is probably not installed correctly.  Did you install XAMPP yourself?  PC or MAC?  Version?

Attachment xampp1-8-3.jpg
Attachment xampp7-1-10.jpg
In reply to Rick Jerz

Re: localhost backup problem

by Sofia Rehan Ramli -

I installed the Moodle Windows package (the standalone with everything is installed together). So it should be included, shouldn't it?

In reply to Sofia Rehan Ramli

Re: localhost backup problem

by Colin Fraser -
Picture of Documentation writers Picture of Testers

You should be able to find it using Windows Explorer, but it has been a long time since  used XAMPP. Go to the XAMPP folder and then Apache > htdocs I think it is, (or maybe it is just Apache > Web or similar these days.) In that folder you should see a list of the apps that are installed. If phpMyAdmin is not amongst them then it hasn't been installed. If you are not sure, or if I have all this wrong, look for the Moodle, that will be in the same folder as everything else.

I reiterate that it is much better to download and install Apache, first, test it making sure it works, then MySQL or MariaDB or PostGreSQL, do a CLI test on that, see if you can get a response. Next PHP, testing that too, as you go. Finally, add in phpMyAdmin and see that it all works. When ready, download and install Moodle. That should all come together nicely. That way, you sidestep the use of XAMPP and will have a much more smoothly operating Moodle.  

In reply to Sofia Rehan Ramli

Re: localhost backup problem

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

I just checked Sofia, and I do not see phpmyadmin being included with the packaged download from moodle.org.  I am not sure where this leaves us.  It might be easier to install a normal XAMPP or WAMP version of AMP, then Moodle.

In reply to Rick Jerz

Re: localhost backup problem

by Colin Fraser -
Picture of Documentation writers Picture of Testers

The XAMPP server package is not static, Sofia, you can install other PHP apps, easily. Download the app, create a folder in the Apache document root folder and copy and paste the unzipped app into that folder; is the usual way of dealing with it. The nature and interaction of Apache, PHP and HTML does not require an installation process as does a Windows based program. It is all connectionless, so that means there is no dark art involved, just copy and paste, then create a bookmark in your browser and the app should run. 

In reply to Colin Fraser

Re: localhost backup problem

by Sofia Rehan Ramli -

Hi,

Sorry haven't done the things you suggested yet, as I am currently trying to test my theory. Most probably this theory is not workable.

The reason I am trying this is, we are trying to develop a system with multiple LMSes with the same layout and content, but they are actually independent of each other. I think with MNet, the super admin will have control of the client LMS, but in our case the super admin / admin of the main LMS will not have control of the other LMSes. We are thinking to sort of provide the clients with preset Moodle with all courses, settings and other plugins set up so they do not have to do them.


Is it possible?