Links and moving Moodle

Re: Links and moving Moodle

by Ken Task -
Number of replies: 1
Picture of Particularly helpful Moodlers

There is an easy fix ... before moving ...

download the backup .sql file to be used for importing on the new system and edit with an text editor: search for http://oldsite/[folder]/ replace with http://newsite/[folder]/

If you have command line on either server can edit the sql dump there using editors such as nano.

or after moving, use the admin tool for search and replace in Moodle:

http://newsite/admin/tool/replace/

use the full URL to search ... ie, http://oldsite/[folder]/ and replace with (as above) http://newsite/[folder]/

'spirit of sharing', Ken

In reply to Ken Task

Re: Links and moving Moodle

by Bret Miller -
Picture of Particularly helpful Moodlers

I find that most links on our Moodle website are absolute, that is they include the full URL. The last time I tested this, it was almost impossible to create a relative URL link. Admittedly that was a few version ago.

We also regularly clone the live Moodle website for testing. The script we wrote uses sed to replace the URL along with some other settings in the data, but HTML blocks are somehow encoded so that sed command doesn't fix the URLs in those blocks. That we do after the site is restored using the search and replace tool Ken mentioned.