https://docs.moodle.org/en/Administration_via_command_line#Reset_user_password
https://docs.moodle.org/en/Administration_via_command_line#Reset_user_password
hi,
does the backup of a course is "stick" to the orginal source server or can i restore it on another moodle server with the same version/release but with differents users, different categories, differents roles ?
will that restoration make bug or trouble with ID or things in the database ?
The only common things between the two servers are :
- moodle version release
- theme template
Thank you for your kindness of information & help.
Might want to read:
https://docs.moodle.org/36/en/Backup_and_restore_FAQ
'spirit of sharing', Ken
ok i read.
so, as my users aren't the same, i guess the response is NO.
if the backup courses was created by the user XXX, i need to have a user named XXX on the target server to make it possible.
why the administrateur of the target server can't appropriate the course owner-rights while he's restoring it ?
Try creating a blank lib/eventslib.php file in your moodle web directory. It should allow you to gain access to the Moodle web UI.
The issue stems from a change in 3.6 that removed this file. I've found it fixes issues with HSU Forums and the Flashcards plugins. I'd recommend sending a note to the plugin developer to alert them of the issue.
If it's something like HSUForum, I'd recommend finding a new forum plugin as it hasn't been updated since 2016 and only "supports" moodle 2.9
"so, as my users aren't the same, i guess the response is NO"
One can make either full course backups that include users and their data in the course, or NO USER backups which still has all the content but no users ... nor their assignments, nor their forum postings, etc. Admin user can restore a backup to any category on new server that exist. Even restore a backup to an existing course.
"if the backup courses was created by the user XXX, i need to have a user named XXX on the target server to make it possible."
Superuser or admin on new server can restore courses of either type (full user backups or no user backups). That user doesn't have to be in either of those types of backups ... probably best the superuser isn't made a teacher nor a student in those backups ... conflict of roles possible (if admin account on both servers were made with same username (admin) same email address).
"why the administrateur of the target server can't appropriate the course owner-rights while he's restoring it?"
Admin user on any system is superuser ... has access rights to all.
There is one way to find out the in's and out's of backups and restores and that's to try it as the admin user.
'spirit of sharing', Ken
Let's step back a minute or two here ... this ...
"The mnet_localhost_id is the same in the config table and the user table in my case its set to 3."
you had used moodle networking on former hosting environment? That environment was what?
There is at least one user that should always remain manual ... that of the initial installer ... user ID 2.
What does this query of your db show:
mysql> select id,auth,mnethostid,firstname,lastname,email from mdl_user where id = '2';
mnethostid for a moodle instance that has never pariticipated in mnet, should be 1.
And by default, without configuring or setting up moodlenetworking, wwwroot and ip columns of mdl_mnet_host table is set to the instance one is in ... https://currentsite and the IP is the IP of the server.
That might explain why switching the DB's to the new db created when installing in config.php one can login.
So when you migrated the site to new host, mind describing how you did that?
In previous postings involving migrating from localhost to server sorta indicated a non-standard approach - like installing a blank site first, then replacing new DB with old DB ... how about moodledata?
'spirit of sharing', Ken
Moodle requires the iconv PHP extension. Please install or enable the iconv extension.
Moodle version:moodle-latest-36.tgz
ubuntu version:
moodle@moodle:/$ cat /proc/version
Linux version 4.18.0-15-generic (buildd@lgw01-amd64-007) (gcc version 8.2.0 (Ubuntu 8.2.0-7ubuntu1)) #16-UbuntuSMP Thu Feb 7 10:56:39 UTC 2019
php version:
moodle@moodle:/$ php -v
PHP 7.2.15-0ubuntu0.18.10.1 (cli) (built: Feb 8 2019 14:54:22) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.15-0ubuntu0.18.10.1, Copyright (c) 1999-2018, by Zend Technologies
php.ini that there is no iconv extension.
I had to install apt-get
when installing
moodle@moodle:/$ sudo apt-get install php7.2-iconv
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'php7.2-common' instead of 'php7.2-iconv'
php7.2-common is already the newest version (7.2.15-0ubuntu0.18.10.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
moodle@moodle:/$ sudo apt-get install php7.2-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
php7.2-common is already the newest version (7.2.15-0ubuntu0.18.10.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
moodle@moodle:/$
How can I install the iconv extension and enable ?
Thank
Just want to share a solution to a problem I had not yet seen. I don't know it's related to 3.5 -> 3.6 upgrade but I think it is because I had never seen it before.
The following error occurred when I tried to cut and paste section text from Course A to Course B:
So this looks pretty bad right? I thought my upgrade had gone wrong. But that's not the case.
What happened:
Solution: when copying a text, remove ALL hyperlinks to files/topics from a different course. That's when you can save the section.
I had no idea that Moodle searched the text for broken hyperlinks when saving a section. The error was not clear to me, I thought there was a server problem with reading files.
Tags: Unknown exception related to local files, File does not exist, storedfileproblem, file_exception thrown
Thank you Mr.Ken Task.
I have corrected using phpmyadmin, as directed by you.
Can you please tell me, How to prevent these errors in future?
Feel free to rate the posting that helped as 'useful' ... that's another way to say 'thanks'!
Glad you have fixed!
How to prevent? To answer that, one would have to know how it happened in the first place - exactly!
Venturing a guess however ... an upgrade was attempted/triggered and immediately cancelled which stopped the entry of the version in the table. IF that guess was true ...
https://docs.moodle.org/36/en/Upgrading
Am a 'fan' of using command line (git+scripts) for updates to code or upgrades to higher versions. Takes minutes and less prone to human error, IMHO.
How to do that with your site is a future exercise for you. Hmmm ... that 'assignment' perfect for setting up a development clone of your production site for learning git and update/upgrade via command line.
'spirit of sharing', Ken
I have about 650 "registered" users, but only about 200 students. I'd like to delete the 450 non-students, all in one fell swoop instead of one-by-one.
Is there way to see/run a query to find non-enrolled users in mysql so I can delete them that way, or is there another way to identify and delete non-students?
Thanks in advance.
I am not the best at this, but I did write the SQL query for myself for this same purpose. If you are good with SQL, you might be able to improve upon this.
I clean up these "bogus" users somewhat regularly. For example, when I ran my query right now I came up with 2 bogus users. In your case, you seem to want to get rid of 450, which could take some time doing it one by one. If you are good with SQL and databases, you could probably find a faster way of doing this.
You might want to consider using Moodle's "Bulk user actions" to start finding groups of bogus users. For example, you might want to find all users that are "not confirmed." Or all users "not in your country." Of the 450, this process might get you somewhat quickly to where you want to be.
Okay, here's the code.
# User who are not valid
SELECT id,
firstname,
lastname,
email,
confirmed,
city,
country
FROM prefix_user
WHERE id NOT IN
(SELECT DISTINCT u.id
FROM prefix_role_assignments ra
JOIN prefix_user u ON u.id = ra.userid
JOIN prefix_role r ON r.id = ra.roleid
JOIN prefix_context cxt ON cxt.id = ra.contextid
JOIN prefix_course c ON c.id = cxt.instanceid
WHERE ra.userid = u.id
AND ra.contextid = cxt.id
AND cxt.contextlevel =50
AND cxt.instanceid = c.id)
AND deleted = 0
AND suspended = 0
AND firstname NOT LIKE "guest user"
Hi there,
Recently we have moved our Moodle onto a cloud server, but our course coordinator still want to access the old local Moodle instance, I have tried to duplicate another source code/web content folder (moodle2) to let him access but it says: "Fatal error: $CFG->dataroot is not writable, admin has to fix directory permissions! Exiting." The dataroot is still accessible by the original Moodle instance (moodle) with write permission for IUSR (We are using IIS).
About the reason that I duplicated another source code/web content directory: We don't want to confuse the student so the original directory is used to redirected to the new Moodle on the cloud (different URL), hence in case the student access Moodle by some shortcuts or bookmarks (old URL) that they created, it will redirect them to the new Moodle, therefore we could not use the original directory for the coordinator access.
Do you have any solutions for this case?
hi,
is there any plugin which can translate one word but only in a URL ? (url would be a condition of the remplacment).
i need to adjust several words depending of the course i visiting.
when i'm on a page liek course=45 , i need the word XX replace by ZZ
when i'm on a page liek course=46 , i need the word UU replace by WW
A translate rule like that.
a feature to enter en URL with a word replacement string would be userful.
This feature exists in Joomla CMS (ReRepalcer plugin):
https://extensions.joomla.org/extension/rereplacer/
The same thing in Moodle would be pretty userful.
thank for help.
Try
https://moodle.org/mod/forum/discuss.php?d=344791
https://moodle.org/mod/forum/discuss.php?d=361624
Or do a Google search on
php iconv install site:moodle.org
Have you definitely downloaded and installed the 32-bit Visual C++ Redistributable for Visual Studio 2015, vc_redist.x86.exe and not the 64-bit one, vc_redist.x64.exe?
In php.ini you should just need the extension=intl line, you can remove the extension=php_intl.dll line.
Hi,
We've had same problems with Moodle Question Banks. Hope these notes help:
To troubleshoot json error when trying to edit a question and adding from the question bank at:
..quiz/edit.php?cmid=XXXX
From the list of questions find any that have ? icon in the list
If no questions of type ?, if possible see if able to edit each question
When looking at the Questions in the database, remember that unlike most activities, the Question Bank is linked to the course and not the course module.
..question/edit.php?courseid=XXXX
Question table structure:
mdl_question_categories - Groups questions together. For each row should be at least one with name top, parent = 0
The contextid field links mdl_question_categories to the course (matches mdl_context id with contextlevel = 50, instanceid = courseid)
mdl_question - Holds question details. category field links row to mdl_question_categories
If a mdl_question_ table exists with the qtype field value at end of it's name, then check that the question has matching value(s) in that table
If find invalid question, quick fix can be to orphan the question row (e.g. by adding 000 to value of category field in mdl_question table) and make record of change.
Be careful that no student results etc attached to this question in mdl_question_answers and mdl_question_attempts tables.
i am having the same problem as well need solution asap anyone willing to help just reply