to resources (from resources and forums) are re-encoded in backup/restore.
I could reduce the code size but for now I prefer to have it this looong
form to clarify what it's doing.
Please, test, test and test...
that the link doesn't belong to the course being restored, then
the original link is mantained.
With this, the backup/restore should be finished. Now some
tests to check everything !!
All the conversion to some pseudo-codes are done at backup time.
In the restore process, every link is decoded to new ids.
For now, this is supported:
- In backup:
-all links to forums are encoded.
- In restore:
- all links to forums are decoded.
- from forums (post->message).
- from resources (resource->alltext).
The process requires a backup made with the same version (because it
has to be properly encoded at backup time). Old backups will work
without conversions at all.
Only tested with some little courses.
It would be perfect to have some "big" course to test it.
Please, test and feedback, ciao :-)
There is now a new field in forum_discussions which has the userid
of the author in it. This saves a lookup every time to forum_posts.
There is also some caching and rearrangement of the logic.
It seems to work OK, I'm about to do some speed tests on moodle.org