MDL-21695 no hidden role assingments any more
[moodle.git] / lang / en / help / uploadusers.html
b7f90666 1<h1>Upload users</h1>\r
d526725b 2\r
3<p>Firstly, note that <strong>it is usually not necessary to import users in bulk</strong>\r
4- to keep your own maintenance work down you should first explore forms\r
5of authentication that do not require manual maintenance, such as\r
6connecting to existing external databases or letting the users create\r
7their own accounts. See the Authentication section in the admin menus.</p>\r
8<p>If you are sure you want to import multiple user accounts from a text file, then you need to format your text file as follows:</p>\r
11 <li>Each line of the file contains one record</li>\r
12 <li>Each record is a series of data separated by commas</li>\r
13 <li>The first record of the file is special, and contains a list of fieldnames. This defines the format of the rest of the file.\r
14 <blockquote>\r
15 <p><strong>Required fieldnames:</strong> these fields must be included in the first record, and defined for each user</p>\r
16 <p><code class="example1">username, password, firstname, lastname, email</code></p>\r
18 <p><strong>Default fieldnames:</strong> these are optional - if they are not included then the values are taken from the primary admin</p>\r
19 <p><code class="example1">institution, department, city, country, lang, auth, timezone</code> </p>\r
20 <p><strong>Optional fieldnames: </strong>all\r
21of these are completely optional. The course names are the "shortnames"\r
22of the courses - if present then the user will be enrolled as students\r
23in those courses. Group names must be associated to the corresponding\r
24courses, i.e. group1 to course1, etc.</p>\r
25 <p> <code class="example1">idnumber,\r
26icq, phone1, phone2, address, url, description, mailformat,\r
27maildisplay, htmleditor, autosubscribe, course1, course2, course3,\r
28course4, course5, group1, group2, group3, group4, group5, type1, type2,\r
29type3, type4, type5, role1, role2, role3, role4, role5, emailstop</code></p>\r
30 </blockquote>\r
31 </li>\r
32 <li>Commas within the data should be encoded as &amp;#44 - the script will automatically decode these back to commas. </li>\r
33 <li>For Boolean fields, use 0 for false and 1 for true. </li>\r
34 <li>Types\r
35are used to tell Moodle whether the user is a student or a teacher if a\r
36corresponding course exists (e.g. type2 corresponds to course2). 1 =\r
37Student, 2 = Editing Teacher, and 3 = Non-editing Teacher. If type is\r
38left blank, or if no course is specified, the user is default to\r
39student. </li>\r
40 <li>For courses use the short name; for groups use group name; for roles use id.</li>\r
41 <li>Note: If a user is already registered in the Moodle user database, this script will return the \r
42 userid number (database index) for that user, and will enrol the user as a student in any of the\r
43 specified courses WITHOUT updating the other specified data.</li>\r
b7f90666 45\r
d526725b 46<p>Here is an example of a valid import file:</p>\r
47<p><code>username, password, firstname, lastname, email, lang, idnumber, maildisplay, course1, group1, type1<br>\r
48jonest, verysecret, Tom, Jones,, en, 3663737, 1, Intro101, Section 1, 1<br>\r
49reznort, somesecret, Trent, Reznor,, en_us, 6736733, 0, Advanced202, Section 3, 3\r
52<h2>Updating existing accounts</h2>\r
54<p>By default Moodle assumes that you will be creating new user\r
55accounts, and skips records where the username matches an existing\r
56account. However, if you set "Update existing accounts" to <b>Yes</b>, the existing user account will be updated. </p>\r
58<p>When updating existing accounts you can change usernames as well. Set "Allow renames" to <b>Yes</b> and include in your file a field called <code class="example1">oldusername</code>.</p>\r
60<p><b>Warning:</b> any errors updating existing accounts can affect your users badly. Be careful when using the options to update.</p>\r