Changing URL / Move Moodle to a new site / Not sure what to ask

Changing URL / Move Moodle to a new site / Not sure what to ask

by Jim Johnson -
Number of replies: 6

Let's say I currently have moodle on www.abcwebsite.com and I want to move it to www.xyzwebsite.com all on the same VPS server.

 

 How would I do that?  I don't know what question to look up in the wiki to figure out what I need to do

Average of ratings: -
In reply to Jim Johnson

Re: Changing URL / Move Moodle to a new site / Not sure what to ask

by Ken Task -
Picture of Particularly helpful Moodlers

The reason you might not be able to find an answer to this specific question is that it's not really a moodle migration, but a domain name change - if I understand you correctly ...

abcwebsite doesn't need to exist or be running anymore and you want the Moodle you have to be accessed by xyzwebsite, is that correct?

If that is correct, using what tools you have for domains/DNS, change it.

The only thing you'd have to do in Moodle then is to edit the config.php file replacing oldsite with newsite.

And then login to the Moodle and run the search and replace tool ... search for the FULL URL: http://oldsite/[moodle]/ (including trailing slash) and replace with FULL URL: http://newsite/[moodle]/

Include [moodle] above IF you ran your site in a moodle directory.

If I am in-correct, please describe/correct.

'spirit of sharing', Ken

In reply to Ken Task

Re: Changing URL / Move Moodle to a new site / Not sure what to ask

by Jim Johnson -

Seems pretty simple....If I am understanding correctly:

1.  Upgrade moodle on www.abcwebsite.com

2.  Install moodle on www.xyzwebsite.com

3.  Use search and replace to make sure everything points to www.xyzwebsite.com

4.  Edit config on www.xyzwebsite.com to point toward current moodle database

5.  Decommission www.abcwebsite.com

In reply to Jim Johnson

Re: Changing URL / Move Moodle to a new site / Not sure what to ask

by Guillermo Madero -

Hi Joseph,

Well, there's a new variable in what you mentioned: 1. Upgrade. For that you need to read the corresponding docs.

What Ken said: 1) change the domain name with the tools you have or use. 2) update info in the config.php file, 3) update database references, from the old domain to the new domain, with the search and replace tool within Moodle. But you never answered his question.

In reply to Jim Johnson

Re: Changing URL / Move Moodle to a new site / Not sure what to ask

by Ken Task -
Picture of Particularly helpful Moodlers

@Guillermo - yep, new information always throws another kink into it.  You weren't wrong nor in-correct.

@Joseph ...

If your system (yet to be disclosed) is such that you are in full control of everything (ie, have access to the apache config file and the virtual apaches you appear to be running), then your summation might be a little correct/incorrect.  If you upgrade the moodle at abcwebsite.com then there is no reason to 'install' a moodle at xyzwebsite.com, is there? One just needs to move that which has been upgraded into the domain space of the other and make edits to config.php.  Then decommission the other.

IF, however, you are remotely hosted on a shared system, the provider may have setup virtual apaches that are tied to a domain name ... ie, path might be something like /home/customerZZZ/abcswebsite.com/public_html/ and /home/customerZZZ/xyzwebsite.com/public_html/

While customerZZZ does have access to both web spaces, there is no tool to 'move' data folder/code folder for abcwebsite.com into the proper location for xyzwebsite.com AND rename them.  Not without having to archive them, download, then turn around and upload to the 'other' space.

Thus, it is 'sorta' a migration and would involve moving the data directory, moving or upgrading the code directory, importing the db from the export of the original site, changing the config.php file, and running search and replace on the DB for olddomain replacing with newdomain as well.

Think I'd pose the same question to the hosting provider and see what they say.

'spirit of sharing', Ken