Install on new host keeps going to old host

Install on new host keeps going to old host

by Lisa Perez -
Number of replies: 6

OK, I'm sure this has been answered someplace and I know that it is probably simple, but I can't figure it out...

I'm moving from one web hosting service to another, keeping the same domain name.  I've installed Moodle to the new host site and can access it directly using the IP address similar to:

111.111.111.111/~username/moodle

However when I try to login or access the /admin, it goes to the old site where the DNS points.  Does anyone know how I can access my new server?

Sorry to bother and thanks for all your help!

Average of ratings: -
In reply to Lisa Perez

Re: Install on new host keeps going to old host

by Lisa Perez -
Figured it out.  Just need to change the config.php file.  Sorry.
In reply to Lisa Perez

Re: Install on new host keeps going to old host

by Lisa Perez -

Just in case you would like to know the details of how I solved it, I will try to provide a more complete description of the solution.

Edit the config.php file which is located in the main moodle directory by changing the domain name to the current IP address.  In the config.php file, the URL of your website will be displayed something like this:

$CFG->wwwroot   = 'http://www.yourdomainname.com/moodle';

Change it to be the actual IP address so that the line looks something like:

$CFG->wwwroot   = 'http://111.111.111.111/~username/moodle';

In reply to Lisa Perez

Re: Install on new host keeps going to old host

by greg mushial -

Lisa -

If I understand the problem correctly - changing to using ipnum isn't the solution. What you need to do is contact the registrar for your domain name and supply to them the names/ipnumbers of the dns servers provided by your *new* hosting service. Otherwise, anyone trying to access your site by ipname will still be pointed to the old site/server provider. The basic problem is: when someone is trying to translate an ipname into an ipnumber, they go to the registrar records which point to the dns servers which have the current information as to how to get to your server. If your registrar is still pointing to your old server provider's dns servers, either a) they're going to get dated info pointing to your old servers, or b) get no information, because you've since left. [we ran into this where we have a domain name parked for some time, had setup a site for that domain, had told the hosting company that name, but had failed to tell the registrar...  the as far as the net was concerned, the domain name still pointed to the "this site is parked" msg page...  after the updating the registrar it took approx 18 hrs for the info to propogate around the web and the dns servers and then we were a happy camper.]

greg

Average of ratings: Useful (1)
In reply to greg mushial

Re: Install on new host keeps going to old host

by E. L. Cooper -
Quite so Greg but an address based config can be useful while waiting for DNS propigation during a server move.
In reply to E. L. Cooper

Re: Install on new host keeps going to old host

by greg mushial -

Quite true...  but only during that transition; and only to/for those that need such during such period of time. For users, never given them an ipnum - they will hard code it into scripts and will become maint headaches down the road when one moves to yet another provider. After 30+ years of handholding for users, one learns how not to set oneself up for needless panicing phone calls...  "my class is about to take finals this afternoon and no-one can get to the server"; "but the servers is up and running - what ipname are you using?" "ipname, I'm using a number in all my scripts and all my students are using likewise" etc etc..  and of course this would never happen  smile sad  been there, done that, have the t-shirt, don't need to do it again.

enjoy, greg