Hi Petr, since the idea is to be independent of courses, to provide a file storage space not dependent on a particular course, then I'd guess it will have to have it's own backup also independently run (probably as an admin function rather than teacher--or perhaps as an option in the course id 1 backup?).
Linked files (files linked into course content from MyFiles directory, a planned but not implemented feature) could be handled via the course's backup, but we'd have to have a way to signal the new course to change the course id in the link to the new course id. The links themselves would be backed by the modules, but they would point to the old course id, so we would have to change the links as the course is backed up, not fun, or manually re-link the links after the backup, not fun at all.
But in the current version, a user with files shared into a course, if the course was backed up and restored to a new course id, they would have to reshare the files to the new course id (which pretty much makes sense anyway, as it is functionally a new course). If the course is restored to the same id, it shouldn't matter, the shared files will still be there (since they are independent of the course).
It may not be a bad idea to try and figure out how to do the relinking of linked files in a course backup, as if there is to be any user centered file system that allows the use of files in courses--in the other mods & blocks, not just shared_files, we'll have to come up with some way to change the links in the course to match the new course id in the linked file path if it is to work with backups. It does conflict with the course centered paradigm of moodle, but we are getting complaints from users who want moodle to be more user centered, and the courses aren't yelling back

.