Deleting users via CSV

Deleting users via CSV

de Albert Ramsbottom -
Número de respuestas: 4

I have been looking at the deleting users csv wiki page and have the following example

username,firstname,lastname,deleted

reznort,,,1

Now can i delete users, using the ID (primary key), and not use the username as some of our usernames are the same


Cheers


Promedio de valoraciones: -
En respuesta a Albert Ramsbottom

Re: Deleting users via CSV

de Howard Miller -
Imagen de Core developers Imagen de Documentation writers Imagen de Particularly helpful Moodlers Imagen de Peer reviewers Imagen de Plugin developers

"some of our usernames are the same"

That sounds very unlikely. The *only* way that can happen is that you have the same username but a different mnet ids. Are you using mnet with *incoming* users from other sites?

En respuesta a Albert Ramsbottom

Re: Deleting users via CSV

de Howard Miller -
Imagen de Core developers Imagen de Documentation writers Imagen de Particularly helpful Moodlers Imagen de Peer reviewers Imagen de Plugin developers

"some of our usernames are the same"

That sounds very unlikely. The *only* way that can happen is that you have the same username but a different mnet ids. Are you using mnet with *incoming* users from other sites?

En respuesta a Howard Miller

Re: Deleting users via CSV

de Albert Ramsbottom -

We are using a custom Course/User import system based on sits

Some teachers have restored courses from an old Moodle where the student ids are different, so Moodle has created two users both with the same username and email but with a different idnumber and auth method

Not sure if that makes sense

So we have a csv from the DB that includes id, username, and idnumber

These duplicate becuase the username and email are the same but they do have the id field as the primary key so was wondering if I could use this in the upoad user csv


Cheers

En respuesta a Albert Ramsbottom

Re: Deleting users via CSV

de Howard Miller -
Imagen de Core developers Imagen de Documentation writers Imagen de Particularly helpful Moodlers Imagen de Peer reviewers Imagen de Plugin developers

The username and mnetid id in the mdl_user table form a unique index. So... assuming your mnetid is only ever 1 (likely) then you can't have different usernames. Unless, of course, your database has been hacked around with to remove the unique index.

In which case.... you deserve your current predicament gran sonrisa