restore a deleted student with same details

restore a deleted student with same details

by Pubudu Premachandra -
Number of replies: 5
I need to restore a student who had deletd from the moodle system.
1) deleting a student don't throw away the delails from the system. am I correct?
 
   since I try to add him again as a new user system tells that "his email address and other data already exist"

Now how to restore him if his data not beign completely removed????????????
Is there easy way like "enable his account again"??????

2) I also want to know how to delete a student permanently from the system but Preserving his postings and workdone in the site??

3)how to delete a student permanently from the system without Preserving his postings and workdone in the site (means delete user and all of the things related to him like assignments forum posts) ??
Average of ratings: -
In reply to Pubudu Premachandra

Re: restore a deleted student with same details

by Michael Goncharenko -

Preved uchasnecheg Pubudu!

I have not checked, but this might help. To restore a deleted user, open your mysql database mdl_user. Find there a record with your deleted student and change this record:
set "deleted" field to 0.
set "username" field back to user name (moodle replaces it with some internal info).

AFAIK, there is no way to delete the student permanently. If you remove his record from mdl_user, a course assignments&information (forum postings, vote results, logs, activities) still will be left in the database.

A good way is to wipe this information out, but you would need a script which (AFAIK, again) has not been written yet.

In reply to Michael Goncharenko

Re: restore a deleted student with same details

by Steve Bilton -
Hello,

I was hoping a script has been written to do this by now if any one knows of how to create this or where to find it if it has already been done? ?:
3)how to delete a student permanently from the system without Preserving his postings and workdone in the site (means delete user and all of the things related to him like assignments forum posts) ??


I.e.To completely remove all deleted/unenroled (those which do not belong to any courses) students and all of their corresponding logs from mdl_logs table.


i'm using a 1.4.2+ (altough i'm using many moodle versions upto 1.8x, would be nice to get a universal script) and need to upgrade, before i can do this i need to remove these users and their logs due to very heavy server loads.

Cheers
Steve

In reply to Steve Bilton

Ynt: Re: restore a deleted student with same details

by Mahmut Kurucu -
I am also interested in this subject. We have to delete users who are not active in the site. How can we delete the users permanently?
I dont want to install the system again by getting backup the courses (about 90-100 courses we have).

I am searching the script that delete the users permanently sad
In reply to Mahmut Kurucu

Re: Ynt: Re: restore a deleted student with same details

by Steve Bilton -
Hello,

Probably the easiest way to delete all users is to first delete them through the moodle interface. Once you have done this visit using PHPMyAdmin and edit your database, you want to go to the table "mdl_user", browse the table and list the contents via the column name "deleted". Any rows that have "1" in this column have been deleted from moodle using the normal moodle interface. Simply select each one then delete the rows. Once you have deleted the rows do a check on the database and a repair. Hopefully this will remove all the dewsired users without a problem PERMENANTLY! However I'm not sure about removing the logs forum posts etc or even if you'd want to, user logs come in very handy as do forums - besides removing forum posts could cause a negative impact as the links will be broken.

Steve