General help

Links and moving Moodle

This discussion has been locked because a year has elapsed since the last post. Please start a new discussion topic.
Picture of Ken Task
Re: Links and moving Moodle
Group 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:


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

'spirit of sharing', Ken

Average of ratings: -
Picture of Bret Miller
Re: Links and moving Moodle
Group 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.

Average of ratings: -