How to move a moodle site

How to move a moodle site

by Michael Knichel -
Number of replies: 4

I currently server my moodle site from ~/public_html/someSite/myMoodleSite

I use https://www.server.com/myMoodleSite

I wish to move it to its own subdir of public_html like ~/public_html/myMoodleSite

I want to use https://myMoodleSite.server.com instead.

Having my moodle site be a sub-dir of my main site is problematic when using git.  It would be better to serve it from its own sub-dir of public_html.

My question is what do I need to change after i copy/move the files to the new location on the server?  I changed config.php so $CFG->wwwroot reflected the new url

The moodle data is still in the same location and an absolute path & the db info is not changing.


MK

Average of ratings: -
In reply to Michael Knichel

Re: How to move a moodle site

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Is Git the only reason for this site URL change? The prescribed solution is to leave everything as it were and change the web root, aka DokumentRoot, to your public_html/whateverthemoodledir.
In reply to Michael Knichel

Re: How to move a moodle site

by Ken Task -
Picture of Particularly helpful Moodlers

Git acquired code has to be run from the code directory and is basically a 'pull' (new code/changes/etc) come from repos to directory - no moving parts) so am kinda surprised that's the issue. 

Issues might arise with location IF a WordPress is at document root for the domain - .htaccess files with rules for WP?

Mr. V is right, however, path of least resistance is to change document root for the FQDN in web service config, but before you that, check config.php file of moodlecode ... if it has https://site/somesub you'll not only have to change that to https://site but also run search and replace on the DB for internal links your Moodle has already recorded in DB rows.

https://docs.moodle.org/310/en/Search_and_replace_tool

'SoS', Ken

In reply to Ken Task

Re: How to move a moodle site

by Michael Knichel -
Thanks Ken. I got it straightened out. I did move it to its own directory and did change the config.php file to reflect the new directory. It is all good now.
I am a git noob so having the dirs separated is good in my mind. They are sort of unrelated sites anyway.

MK