How to manually copy files from one course to another

How to manually copy files from one course to another

بواسطة - Helena Garcia
عدد الردود: 3

I'm coding a local plugin in Moodle and I'm trying to copy resources from one course to another one manually (not doing a backup and restoring).

I've tried to manually get the resource, the course_module, the context and finally the file from DB, then copying rows and updating the fields that concern to the new course, and also chaning SHA1 from pathnamehash file's table field.

Any ideas or alternatives to do that?

Thanks!

متوسط التقييمات: -
رداً على Helena Garcia

Re: How to manually copy files from one course to another

بواسطة - Tim Hunt
صورة Core developers صورة Documentation writers صورة Particularly helpful Moodlers صورة Peer reviewers صورة Plugin developers
رداً على Tim Hunt

Re: How to manually copy files from one course to another

بواسطة - Helena Garcia

It was very useful, thank you مبتسم