I've made sure that all links in resources are in slash arguments format and the restore has updated the location of the file to the correct new course...
however each instance of file.php as it appears in the editor of the restored file is
http://localhost/moodle/file.php/......
i.e. it is pointing to the php code on localhost, which is fine for me on my laptop but not for anyone else; my understanding from our earlier discussions on this is that the wwwroot is updated in the restore
Any ideas, short of doing a find and replace for localhost on the moodle.xml file in the backup?
Much appreciated in advance...Andy D
Re: Ongoing problems moving courses between servers
sorry by he delay, I forgot this message!!
As you said in your previous post, all the file.php calls are "translated" on the fly from their old location to the new one.
This included the translation of:
- Your old wwwroot to the new one
- Your old course->id to the new one
If the course->id modification is working fine (as you said in your previous message), I only can imagine one reason to your issue:
In your destination server, the wwwrooot variable is pointing to "http://localhost/moodle" too.
Can you confirm this? If it is false, then your course->id shouldn't be translated!!
Ciao
Re: Ongoing problems moving courses between servers
Re: Ongoing problems moving courses between servers
relative links (ie. "images/mylogo.jpg") needn't to be transformed in the backup/restore process at all. They will work in the new (destination) server without modifications.
If relative links are modified by the HTML editor to absolute links (ie. "http://URL/file.php/COURSEID/PATH_to_mylogo.jpg"), then the backup/restore will transform the URL and COURSEID to their new destination automatically. Obviously the "file.php" and "PATH_to_mylogo.jpg" will remain unchanged.
So, every absolute link generated by the editor, using the file.php script will be transformed without problems at all (I think).
Ciao
PS: All this is with "slasharguments" on, of course!
Re: Ongoing problems moving courses between servers
Strange, which version of the HTML-editor?
How can I look at the paths in the backup.zip?
Re: Ongoing problems moving courses between servers
sorry but I don't understand you . What is strange? In my previous post I only explained how relative and absolute links are being transformed in the backup/restore.
I think that it hasn't anything to do with HTML-editor. I only named it because in your post you did it! That transformations are absolute independent from the editor used.
Any comment?
Ciao
PS: To see what is being transformed, you can unzip your backup file, then take a look to the moodle.xml file. Every occurrence of "$@FILEPHP@$" is an absolute path link and it will be transformed to fit in the new server/course perfectly.
Re: Ongoing problems moving courses between servers
Re: Ongoing problems moving courses between servers
Thanks for the reply
The wwwroot is not pointing to localhost, it is pointing to an ip address rather than a URL, but I don't think this is the problem.
As a further test, I have hust restored another course form a completely different source (Ray Lawrence's Getting started course from the moodle exchange), and it does everything that it is supposed to do (thanks Ray,if you are reading this) - so I know it's my course, not the restore process as such
Historically, the course was created in moodle 1.2, without slasharguments but I have tried my best to ensure that all references to file.php in the editor are done with slash arguments, which is now supported on our production server and my laptop.
It's been moved around between 3 servers - is there any information in the moodle.xml which could make the program that the code is old, so the updating wwwroot doesn't work
Andy D
I think I've got is sussed
I took a lazy guess - I asssumed that if I changed the ? format to / format in moodle.xml in the backup all would be well, but I've found the way that you replace file.php... with FILEPHP to update the course and I think I can cure this on my own - if I need further help I will be in touch
Pays to look at things carefully
In fact cured it - it weas to do with ? instead of /, I just needed to thoroughly remove these at the html source level. Now very happy, as the course is to be distributed to other UK colleges as part of something called the Qprojects and confident my colleagues elsewhere will now be able to use it
Andy D
Re: Ongoing problems moving courses between servers
you are correct. If your original course backup was created in a site without the slash arguments activated then the $@FILEPHP@$ conversion won't work.
You've to edit the moodle.xml file and replace every occurrence of:
http://your_wwwroot/file.php?file=/your_original_courseid
to
$@FILEPHP@$
Then, with slash arguments activated in your destination site, all the transformations should work.
Ciao
PS: Anyway, I'm thinking that I can modify the backup (and restore) process to take care of the slash-arguments setting and make the $@FILEPHP@$ conversion to work always!. Please, if you can create a bug in http://moodle.org/bugs TIA!
Re: Ongoing problems moving courses between servers
Re: Ongoing problems moving courses between servers
Re: Ongoing problems moving courses between servers:
Tested the files that you sent me.
A course with a mixture of slash args and file.php?= for image urls
Backed up and restored successfully to 2 servers:
- localhost (ie where it came from) moodle 1.3.2
- production server (using ip address for wwwroot) moodle 1.3.1
so should please a lot of people moving courses between servers - make sure that you make the files available CVS and draw attention to them; comment on bug report
Thanks very much indeed - I am very grateful
Cheers Andy D
Re: Ongoing problems moving courses between servers:
thanks for your feedback. I'll close Bug 1634 in some hours.
Modified files are now in CVS and I highly recommend you (everybody) to wait some days because Moodle 1.3.3 is coming and it'll include such modifications...
Ciao