I have a 2.4 GB backup file (course contains a lot of video, obviously, and we cannot use an external video server). I want to extract just a few activities and restore into another course. So I select a subset of activities (say 18 - 26 of 26 total) and the resulting backup file ends up being almost as large as the entire course backup file (2.2 gb or so).
I examined the backup file and in the "files" folder there are sub-folders that actually contain all of the videos from activities 1 - 17 even though I thought I had specifically excluded activities 1 - 17 from the backup.
I've tried modifying the backup.mbz file manually but cannot quite get it right. The closest I have come is to create a smaller backup file that does not contain the unwanted content; however, when restored it creates blank activities in addition to the subset of activities that I wanted.
I'll take a stab at explaining ... if I get it wrong, am certain others will correct.
When you first make a backup, Moodle doesn't know your intent ... ie, what you plan to do with the backup. Restore to another Moodle server, restore to another course, restore to the same course, restore to Canvas, etc. ,etc.
So whatever you've selected to backup has to include those video files. Backup might be large.
In the restore (really import) process, you are selecting the option to restore to existing course, which should mean your intent is to add sections/new content to existing course. That course to which you are restoring has no similar/exactly alike links to the videos.
When Moodle sees a file that is in the backup and it can also locate the same file in the system, it should simply point to the file that already exist in the file system. Thus, one could have 10 courses with a video link and in all 10 courses that video link goes to the same video file - one file.
If one tries to manipulate a backup manually, one had better know what they are doing ... or results are as you have discovered.
** You might, however, consider a plugin ... Sharing Cart:
'spirit of sharing', Ken