Forums | Mahara Community
Support
/
Deleted Group: Missing content on restore
03 April 2014, 22:33
Hi all..
A user here deleted a group.
I've managed to re-enable it by modifying the 'deleted' field in the database table, however all the content has vanished!!..
I got an old copy of the database and restored all the rows for the 'artefact' table that related to that group ID, but still the group has no content in it :-/..
Anyone have any ideas? It's almost like I need to reload the cache or something I don't see why it's missing
Thank you in advance
07 April 2014, 10:42
Hi Adam,
When one deletes a group the following commands also happen (as well as updating the group to marked as deleted), so you will need to look in your old copy for rows in those tables relating to the id of the deleted group and add the missing data back in.
delete_records('group_member_invite', 'group', $group->id);
delete_records('group_member_request', 'group', $group->id);
delete_records('view_access', 'group', $group->id);
// Delete views owned by the group
require_once(get_config('libroot') . 'view.php');
foreach (get_column('view', 'id', 'group', $group->id) as $viewid) {
$view = new View($viewid);
$view->delete();
}
// Release views submitted to the group
foreach (get_column('view', 'id', 'submittedgroup', $group->id) as $viewid) {
$view = new View($viewid);
$view->release();
}
// Delete artefacts
require_once(get_config('docroot') . 'artefact/lib.php');
ArtefactType::delete_by_artefacttype(get_column('artefact', 'id', 'group', $group->id));
// Delete forums
require_once(get_config('docroot') . 'interaction/lib.php');
foreach (get_column('interaction_instance', 'id', 'group', $group->id) as $forumid) {
$forum = interaction_instance_from_id($forumid);
$forum->delete();
}
23 April 2015, 20:02
Thanks for that information!
We got the same problem, group deleted by an user;
set the "deleted" field in database from "1" to "0", but all content is missing now.
Is there some kind of restore-script or something planned? Restoring all the content by hand according to the list posted here is a timekiller and in my mind unreasonable.
What´s about group-backups, like course-backups in Moodle (maybe even automated too)?
Thanks for answers!
24 April 2015, 11:11
There's a wishlist item for Backup & Restore of groups, but it's not in active development at the moment.
If you'd like to speed it up, you can click the "This bug affects me" link, and/or if you've got some budget, sponsor its development. https://bugs.launchpad.net/mahara/+bug/732971
Cheers,
Aaron