I'm not sure if this is relevant, but the course, which is #58 on the source site, was restored into course #1 of the target site. This was done so that the images would become Site Files and would be visible everywhere in the target site (all question categories are published in the target site). This is supposed to work, and it seems to work just fine.
After the restore, I logged in as a teacher in one of the courses in the target site to check out the questions. To my surprise, many of the images appeared as broken links, while others displayed properly. I looked for a pattern and discovered the following.
Consider what happened to one of my images. On the original site, the img src attribute looked like this:
http://sourceSite/file.php/58/images/CBOS/CBOS 1-3-18.jpg
Notice the space in the file name? Yes, I know: a terrible practice, but it seemed like a good idea at the time
After restoring the backup into course #1 in the new site, the img src attribute looks like this:
http://targetSite/moodle/file.php/1/images/CBOS/CBOS%201-3-18.jpg
So the restore re-mapped the image src URI very nicely, EXCEPT for the way it handled the space in the filename. It replaces blanks by 20%. In fact, all image files with names containing spaces have this problem and display as broken links. Unfortunately, there are over a thousand such files.
I have two questions:
- Is this a bug in backup/restore?
- is there a relatively quick way for me to repair my target site? I don't want to have to go back to the source site and rename all my images. This would take days! For example, what if I manually rename target site file names by replacing space by 20% ?