Since the URL of a Moodle instance is stored in its configuration, if you happen to "move" an installation, say from http://mydomain/testmoodle/ to http://moodle.mydomain, needs a few tweaks.
What is the neat way of handling that?
The server is Linux with full (user and root) shell access.
The site URL is set in the file /testmoodle/config.php as wwwroot.
Open config.php in a text editor, there will be a line:
Open config.php in a text editor, there will be a line:
$CFG->wwwroot = 'http://mydomain/testmoodle';
Change this to read:
$CFG->wwwroot = 'http://moodle.mydomain';Job done.
No it isn't stored in the database - UNLESS someone has placed a self-referring link somewhere in a resource.
It's kinda the point of the config file - vital information in one place
It's kinda the point of the config file - vital information in one place
As Howard says.
It helps if your test moodle is in its own subdomain, e.g. test.mydomain.com so you can then structure relative links in the form
It helps if your test moodle is in its own subdomain, e.g. test.mydomain.com so you can then structure relative links in the form
<a href="/course/view.php?id=5"> click here! </a>
then when you move the site to live.mydomain.com all the links will work.
Hi James
> It helps if your test moodle is in its own subdomain, e.g. test.mydomain.com so you can then structure relative links ...
Yes. I have it like http://moodle.mydomain for the production, http://moodle.mydomain/testmoodle/ for the test-run.
I really don't have control over what sort of URL links the course creators set. Will do a SQL dump and check.
Thanks for all the responses!
Visvanath
> It helps if your test moodle is in its own subdomain, e.g. test.mydomain.com so you can then structure relative links ...
Yes. I have it like http://moodle.mydomain for the production, http://moodle.mydomain/testmoodle/ for the test-run.
I really don't have control over what sort of URL links the course creators set. Will do a SQL dump and check.
Thanks for all the responses!
Visvanath
The only other thing you should watch out for is if you (or anybody else) has used self-referring links anywhere in resource texts. If that is the case and you have a manageable number of courses you may be better to use backup and restore which takes care of that kind of stuff.
That was my suspicion too. I expected a full database dump, a run through sed and a restore.
But all the Gurus say that is not necessary, "unless there are self-referencing links in content".
But all the Gurus say that is not necessary, "unless there are self-referencing links in content".