Authentication

 
 
Picture of Visvanath Ratnaweera
Creating a fresh substitute for site with LDAP auth and auto enroll
Group Particularly helpful Moodlers
This is about a Moodle site from a medium sized school. The original version was some 1.4 and successfully upgraded through all the major versions. Currently on 1.9.14.

It has http://docs.moodle.org/19/en/LDAP_authentication and http://docs.moodle.org/19/en/LDAP_enrolment set. The speciality of this setup is that the subject teachers get a meta course of their own and they enroll "class courses" into their course as required.

After that many years we want to make a fresh start. This is the idea:
1. Make a copy of the present (1.9.14) code
2. Get the copy running as http://moodle.example.com/test19/ with a fresh database and moodledata.
3. Configure LDAP identical to the original
4. Execute auth/ldap/auth_ldap_sync_users.php and enrol/ldap/enrol_ldap_sync.php
5. Export/import the course contents from the original to the test site.
6. Once all is fine, swap the URLs.

Steps 1 - 4 all OK. Step 5 gives me "Some problems were detected when checking user data (Trying to restore user 'admin' from backup file will cause conflict, Trying to restore user 'firstname.surname' from backup file will cause conflict)", although I've backed up _without_ user data.

My first guess is that the Moodle's own user IDs don't match. I'm digging into it further, but would like to get feedback from the authentication group. Is my idea wrong? Is there a better way of achieving the same?
 
Average of ratings: -
Picture of Iñaki Arenaza
Re: Creating a fresh substitute for site with LDAP auth and auto enroll
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers

Hi Visvanath,

even if you backup the course up without user data (for the activities) it looks like you backed up the course users (and probably the role assignments in the course too). These are two different settings.

If you want to restore the activities, but not the users themselves, make sure you disable the restore of the course users (setting (1) in the attached picture). Also worth having a look are settings (2) and (3) in case you backed up user data or user course files.

Saludos. Iñaki.


 
Average of ratings:Useful (1)
Picture of Visvanath Ratnaweera
Re: Creating a fresh substitute for site with LDAP auth and auto enroll
Group Particularly helpful Moodlers
Hi Iñaki

I took a fresch backup (see the settings) and repeated. Still the message is:
"Some problems were detected when checking user data (Trying to restore user 'alisa.sample' from backup file will cause conflict, Trying to restore user 'admin' from backup file will cause conflict)"

I unzipped the backup file. moodle.xml has admin in two places:
<BLOCK>
        <ID>175</ID>
        <NAME>admin</NAME>
        <PAGEID>23</PAGEID>
        <PAGETYPE>course-view</PAGETYPE>
        <POSITION>l</POSITION>
        <WEIGHT>3</WEIGHT>
        <VISIBLE>1</VISIBLE>
        <CONFIGDATA>Tjs=</CONFIGDATA>
        <ROLES_OVERRIDES>
        </ROLES_OVERRIDES>
        <ROLES_ASSIGNMENTS>
        </ROLES_ASSIGNMENTS>
...
      <USER>
        <ID>2</ID>
        <AUTH>manual</AUTH>
        <CONFIRMED>1</CONFIRMED>
        <POLICYAGREED>0</POLICYAGREED>
        <DELETED>0</DELETED>
        <USERNAME>admin</USERNAME>
        <IDNUMBER></IDNUMBER>
        <FIRSTNAME>Site</FIRSTNAME>
        <LASTNAME>Administrator</LASTNAME><code>
there are many users in the form
<USER>
        <ID>1610</ID>
        <AUTH>ldap</AUTH>
        <CONFIRMED>1</CONFIRMED>
        <POLICYAGREED>0</POLICYAGREED>
        <DELETED>0</DELETED>
        <USERNAME>angela.sample</USERNAME>
        <IDNUMBER>angela.sample</IDNUMBER>
        <FIRSTNAME>Angela</FIRSTNAME>
...

Why there are so many users in the backup?

Just to make sure, my original idea of a cleaning the Moodle from old information should work, correct?

 
Average of ratings: -
Picture of Iñaki Arenaza
Re: Creating a fresh substitute for site with LDAP auth and auto enroll
Group DevelopersGroup Documentation writersGroup Particularly helpful Moodlers

Hi Visvanath,

Why there are so many users in the backup?

Because you told moodle to include the course users as part of the backup smile (see attached image).

Just select 'Keine' ('None') at they won't appear in the backup file at all. Beware this disables the backing up of Exercise and Workshop activities (in Moodle 1.9.x), as Moodle tells you in the next screen of the backup process.

Saludos. Iñaki.


 
Average of ratings:Useful (1)
Picture of Visvanath Ratnaweera
Re: Creating a fresh substitute for site with LDAP auth and auto enroll
Group Particularly helpful Moodlers
How dumb! It clearly says "Users" and "User files".
:-\

The user collisions are gone.

I'm curious to know how user data bahave. Will let you know.

Thanks very much!
 
Average of ratings: -