a did a mistake using https://moodle.org/plugins/tool_inactive_user_cleanup plugin so I have deleted some users and activities their relations.
I don't want to restore from a full backup and so I restore users accounts using https://moodle.org/plugins/tool_userrestore plugin. Now users are correctly restored with the same id, username, password, and details. The next step is to restore courses enrollments. So I bring to life a new moodle installation with a database backup prior to the delete operation.
The question is: what is the correct SQL query to do this? Otherwise is there a god strategy for restore (enrollments, activities graduations, quiz values,...).
Thanks in advance for your support.