I recently changed my moodle install to another server and hence a different URL
eg www.domain.com/moodle to moodle.domain.com
All of the pictures and files that have been added using the wysiwyg editor still refer to www.domain.com/moodle even though I have changed the settings in the config.php file and the admin pages to reflect the new server settings.
I don't want to have to upload all of the files and change URLs for each one.
Is there an easy way to accomplish this?
----
I have never understood why, when you insert an image from your course files in the HTML editor, the editor uses an absolute URL (

I took the site off line.
Backed up first.
Did a sql dump
In wordpad I used find and replace (took a couple of minutes).
Dropped the moodle DB and then recreate with the altered sql file.
All up about 15 minutes - completely painless and all links repaired.
Hi all,
I am very new to Moodle and am trying to develop a course. I have set up my course on local machine using XP. Now all of my links are http://127.0.0.1/whatever
This is fine for developing but I tried accessing my course through another computer and, of course, all of the links are broken. I have read through this discussion and the one referred to above but I am having trouble following some of it.
Could you explain in more detail how to perform an sql dump. I get the idea but I have no idea how to start it. Is this another program I have to download? Do I open the command interface in XP? What about all of the arguements to use if I do use the command interface? Is there a better way for a newbie?
I tried using http://127.0.0.1/admin/replace.php which was referred to but even though I got a long list of replacements ("yadda yadda yadda ... Success!")every link I looked at was still broken.
I would also like to reiterate the question, why does moodle not use ../linkgoes here.php instead of http://whatever.org/linkgoeshere.php so that it would be more easily portable to a new server? Could there not be an administrator option like 'Port to new server'?
Thanks in advance for somebody taking their time.
Doug
Hi,
I'm answering my own question here. Using http://olddomain.org/admin/replace.php to replace "olddomain.org" with "newdomain.org" didn't work but then after I edit config.php using notepad to relflect the newdomain, everything worked out. (Which I think is actually what was recommended above)
Thanks,
Doug
P.S. Hey Doug next time RTFM.
I checked the HTML Editor forum for an answer to the question "why are absolute links used instead of relative ones?" The answer is found in this discussion.
How did you do sql dump?Am afraid i dont know whats that, where to go and do it.Can you help plz by specifying how did you do this step?
thank you,
amer
Please read the rest of the discussion, specifically the two posts by Douglas Sirkka. You will see that it is unnecessary to dump and edit the sql. It is much easier and safer to use the replace.php script
Notice that the replace.php does NOT change all links. Forexample, links for picture wont be replaced by the new link. I tested replace.php and found that it will leave links unaltered here and there.
regards,
amer
Sorry I only caught this post now.
Do you use phpmyadmin or mysql administrator? phpmyadmin is the easiest.
If phpmyadmin - go to the moodle db and export.
Select all tables in the select all option.
Select as file and it will dump a moodle.sql file (you just need to select the location).
Right click the file and go to open with wordpad (better than notepad for this) and is available on any windows desktop or server.
In the Find what box add http://www.moodleold.com
In the replace box add http://www.moodlenew.com
Depends on your domain name.
When done save it.
Then dump your old moodle database.
Create a new moodle database using phpmyadmin with the same name.
Select upload and find the newly changed sql and upload it.
You only need to alter your moodle config.php file and then you are done.
Happy days - job is done.
Are ALL image links unchanged, or just some of them? If just some of them are unchanged, are those links coded differently from the ones that get changed? If they look the same, there must be a bug in replace.php and you should report a bug in the tracker.
Hi John,
If you use the metod that I described then all images are changed - images and docs. I saw in a post in the linked forum that I used to do this that replace.php doesn't do this properly and it was a known issue.
It does depend on which method you are most comfortable with.
Hi,
I changed my moodle URL using the replace.php, all the link of the resources works fine after that. But the logos,icons & images of the whole site are gone, I have no idea how to resolve this issue.
Anyone can help?

Hello,
Our school is trying to move moodle from a windows 2003 server, using an IP address, to a Debian Linux server, using a Domain Name and I would appreciate some help.
The problem is that: When the "new" moodle is run it retains some of the links to the "old" website using the IP address instead of the new Domain Name.
Attempted:
- It does not seem to matter whether I use PHPMyAdmin or Mysqldump to extract the database and then search and replace using various text editors (allways carefull to output in UTf-8) and then import (into a new database).
- Replace.php reported sucess but in fact did not work. Changes to config.php, were also made and have had no effect.
Has anyone moved a site from an IP address to a Domain Name?
Thanks in anticipation.
- Ensure domain name resolves correctly to new webspace/server.
- Export the database from old server using MYSQLdump.
- Perform a search and replace in the SQL file.
- Change settings in config.php to reflect new domain name.
- Check any custom themes and plugins.
- Upload files to new web space.
- Import edited SQL dump file into database on new server.
- Open Moodle at new location and check thoroughly.
However, you may find when you search and replace in the SQL dump file that you may need to search for several different strings. For example, "http://192.168.220.130" and "192.168.220.130".
You'd think just searching for the latter would catch everything, but I have found that sometimes (depending on what editor you're using) you may have to search and replace several permutations of the IP address string to catch everything.
Thanks Dale,
When replacing just the IP, as in your latter example, should the replacement be:
Well, the migration seems to have gone well; inasmuch as the links are pointing to the new Domain Name and I can navigate around the site - thank you. I exported the MySQL database from the Windows machine, imported it into the Linux installation and then ran replace.php to fix the links.
But, when I check the plugins I see, for example, "Block mrcutejr is not compatible with the current version of Moodle and needs to be updated by a programmer".
I checked the versions of Moodle and they are the same.
How do I update mrcutejr? (I did not install the original).
I would like to change the directory/folder in which my moodle is installed. Currently the installation is in the root directory of my server i.e. mydomain.com I would like to move the installation to mydomain.com/moodle but think I have to do some editing of config.php and lib.php files which I have no idea of how to do or even if that's all. I created a moodle folder inside my root folder and copied all files into it however I got messages about config.php and lib.php errors when I tried to open mydomain.com/moodle.
The reason for this is so that my existing domain www.mydomain.com will now serve as a website which links to the login of my moodle.
Can anybody give me a walkthrough of how to do this if possible?
Cheers
Wheelie
Another good reason for MDL-35099.