One of my clients has backed up and restored her course on top of same existing course without student data. There is no backup with student data available. However, I do have an old report with users and found the grades for the assignment activity in mdl_grade_grades_history but with coursedeleted. My question given that it is the same course db id, could I change (in the backend tables) the assignment activity id to what is was prior to the course overwrite and re-enroll the users, and would the grade data repopulate? Or am I not taking into other complexities? Like the fact the grade data has moved into the mdl grade grades history.
Just export the data to a csv file and then use the import grades feature in the gradebook to repopulate grades.