Backing up html resources with links/images

Backing up html resources with links/images

by Andy Diament -
Number of replies: 5

Hi

HTML resources in moodle store references to images (including smilies) as full url's; this includes links to other moodle activities ('click here for quiz'...)

When I moved a course from my laptop to main server, it did not update these links and I had to do them all manually (or delete the links)sad

This was especially annoying since the htmlarea editor is setup to look for uploaded images in moodledata directory, but stores the full url's, and can't use the moodle $CFG->dirroot  or $CFG->wwwroot variables

Any thoughts on how to get round this?thoughtful

Andy D

Average of ratings: -
In reply to Andy Diament

Re: Backing up html resources with links/images

by Zbigniew Fiedorowicz -
You can unzip the backup and do a global search and replace on the urls in moodle.xml. Then zip the modified backup and restore.
In reply to Zbigniew Fiedorowicz

Re: Backing up html resources with links/images

by Andy Diament -

Nice idea - I will try it next time!smile

Andy D

In reply to Andy Diament

Re: Backing up html resources with links/images

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Andy,

perhaps this discussion contains good news for you. cool

With that, I suppose that all your links (using the file.php script, as the HTML editor does!!) will work...It will be present in 1.3.

Ciao smile
In reply to Eloy Lafuente (stronk7)

Re: Backing up html resources with links/images

by Andy Diament -

As always, I am stunningly impressed with the fantastic work done by the moodle development community and I must apologise for not looking for the disucssion myself!

Warmest regards big grin

Andy D

In reply to Andy Diament

Re: Backing up html resources with links/images: problem in lesson Module

by Andy Diament -
Hiya, I'm returning to this one because I just backed-up a course up  from a moodle 1.3 site, restored it to a 1.3.1 site and the url's of images and smileys in the pages of Lessons do not update to the new domain [in this case, localhost] clown

I was able to replace this in the xml file (thanks Zbigniew) smile

Thanks, Andy D