Quantcast
Channel: Installing and upgrading help
Viewing all 46919 articles
Browse latest View live

Re: Cannot login after moving site to new server


can i backup a course from a server and restore it on another server ?

$
0
0
by pierre REMY.  

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.


Re: can i backup a course from a server and restore it on another server ?

Re: can i backup a course from a server and restore it on another server ?

$
0
0
by pierre REMY.  

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 ?

Re: Moodle 3.6 upgrade - Blank Page - 500 error

$
0
0
by David Pesce.  

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

Re: can i backup a course from a server and restore it on another server ?

$
0
0
by Ken Task.  

"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


Re: Cannot login after moving site to new server

$
0
0
by Ken Task.  

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.

$
0
0
by paul zhou.  

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


[Upgrade 3.5->3.6] Stored file problem (SOLVED)

$
0
0
by Richard van Iwaarden.  

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:

  1. The text that I cut and paste from course A to course B had a link to a file in course A
  2. Pasting the text in a section in course B works, but the error occurs when you try to save the section.
  3. It has to do with the hyperlinks in the copied text. When a hyperlink points to a file in course A, you will not have acces to it from course B. This is what gives the error.

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

Re: config table does not contain version

$
0
0
by murugan m.  

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?

Re: config table does not contain version

$
0
0
by Ken Task.  

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



Is there way to see/run a query to find non-enrolled users in mysql?

$
0
0
by Katrina Belcher.  

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.

Re: Is there way to see/run a query to find non-enrolled users in mysql?

$
0
0
by Rick Jerz.  

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"

Multiple Moodle intances and same database and moodledata

$
0
0
by Hoang Nguyen.  

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?

Re: Multiple Moodle intances and same database and moodledata

$
0
0
by Visvanath Ratnaweera.  

Hi

You wrote:
> we have moved our Moodle onto a cloud server, but our course coordinator still want to access the old local Moodle instance

If you haven't deleted the original Moodle instance, you reactivate it under a different URL, just as an archive.
.
> 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

The correct method is documented under https://docs.moodle.org/en/Moodle_migration. Yes, duplicating a Moodle instance is effectively a Moode-to-Moodle migration.

> The dataroot is still accessible by the original Moodle instance (moodle) with write permission for IUSR (We are using IIS).

Sorry, I have no idea of IIS or other Microsoft products. Hope somebody else will jump in, if you have further questions.

is there any plugin to translate word by URL ?

$
0
0
by pierre REMY.  

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.

Re: Moodle requires the iconv PHP extension. Please install or enable the iconv extension.

Re: Moodle 3.4.1+ admin/environment/php extension/intl

Re: 3.6.1 json error

$
0
0
by Dan Bartlett.  

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

  • Go to activity Question Bank - Questions (from More... options)
  • From the list of questions find any that have ? icon in the list

  • Try and delete these ones. Usually unable to via the web and need to go to database
  • If no questions of type ?, if possible see if able to edit each question

  • Broken questions will throw up page with error message and again unlikely to be able to delete from web

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

  • Not all valid qtype values have a matching mdl_question_ 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.


Re: Issues installing Moodle 352 into wamp on localhost

$
0
0
by rahul bansiwal.  

i am having the same problem as well need solution asap anyone willing to help just reply

Viewing all 46919 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>