Backup & restore - problem with group membership in forums

Backup & restore - problem with group membership in forums

by Lisa McIver -
Number of replies: 3
We're trying to move some courses from an installation of Moodle 1.4 to a separate installation of Moodle 1.5.  We're using the backup and restore functions but are finding a problem with regards to the restoration of the groups (specifically within forums).

Basically, it seems that the group ID information (in the discussion forum table) is not being updated.  This field does contain an ID, but it is the old one and so although the discussion contributions have been moved successfully onto 1.5, they cannot be seen by their owners.

Any suggestions?
Average of ratings: -
In reply to Lisa McIver

Re: Backup & restore - problem with group membership in forums

by Si :) -
Here's the solution!...

There is a typo in the mod/forum/restorelib.php file which prevents grouped discussions being assigned a new group id, and instead they keep the group id from the source Moodle installation - meaning they are inaccessible.

To fix this go to mod/forum/restorelib.php and at line 219 (ish) you should see this...

$group = backup_getid($restore->backup_unique_code,"group",$discussion->groupid);

...it should be this...

$group = backup_getid($restore->backup_unique_code,"groups",$discussion->groupid);

...that's it!

I have raised a bug with this solution here: http://tracker.moodle.org/browse/MDL-6363

I hope that helps someone 'coz it took ages to spot it!

Si smile
In reply to Si :)

Re: Backup & restore - problem with group membership in forums

by Guido van der Waals -

Thanks, thanks, million ...

I had the same problem with wiki and groups.

So I made a similar change in mod/wiki/restorelib.php, and it works glimlach.

I think its a good idea if someone looks at all restorelibs.

In reply to Si :)

Re: Backup & restore - problem with group membership in forums

by Richard Jones -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Hey Si

It sure helped me 'cos on 1.6.2 (using a local XAMPP test install) I had the identical problem restoring separate group wikis from a production server - now I have also changed the /mod/wiki/restorelib.php file in the way you described and my wiki restores the group pages too.

This info (about the need to alter corresponding wiki - and chat files) is also noted in the bug-tracker entry you referenced.

Thanks a million also
Richard big grin