migration of moodle from localhost to live server.

migration of moodle from localhost to live server.

by mano bobi -
Number of replies: 6

I am using moodle 2.7.1. new to moodle , I uploaded all my file and directories. i open my moodle site URL but it show me "Fatal error: $CFG->dataroot is not configured properly, directory does not exist or is not accessible! Exiting.". I don't know in where at server side i should upload 'moodledata' directory and what $CFG->dataroot i should write.

anyone help me out.. thanks

Average of ratings: -
In reply to mano bobi

Re: migration of moodle from localhost to live server.

by Fred Riley -

$CFG->dataroot is defined in your config.php file in the Moodle root directory. Your localhost installation probably contains a value similar to my config (I run Moodle off XAMPP locally):

$CFG->dataroot  = 'C:\\xampp\\moodledata';

The error message is telling you, rightly, that such a directory does not exist on the server. You need to edit config.php to change the dataroot value to the path of your Moodle directory on the server. You need to ask your hosting service what the path is.

I haven't had to move a Moodle installation from localhost to server, so I can't advise from experience. However, the following I found via Google and may be helpful:

Installing Moodle (Moodle Docs)

Moodle migration (Moodle Docs)

move from localhost to hosting (StackOverflow)

I doubt that there is an automated way to move from localhost to server, and expect that it has to be done manually, including script editing and database export/import. 

Fred

Average of ratings: Useful (1)
In reply to Fred Riley

Re: migration of moodle from localhost to live server.

by mano bobi -

Thanks fred.

I got solution by creating moodledata directory at server and use php function to get right path of modledata directory at server. set it in config.php according to it. now its working. smile

In reply to mano bobi

Re: migration of moodle from localhost to live server.

by Kevin Patel -

Hi mano,

I'm about to do the same thing as you by switching from localhost to a live server, so I just wanted to ask if you could write out the exact steps you did to get it working. Thanks!!

In reply to Kevin Patel

Re: migration of moodle from localhost to live server.

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
In reply to Visvanath Ratnaweera

Re: migration of moodle from localhost to live server.

by gayu shan -

Am not clear about those steps , please anybody help me to migrate my moodle site from localhost to live server....... PLEASE

In reply to gayu shan

Re: migration of moodle from localhost to live server.

by Luis de Vasconcelos -

What have you already tried?

Are you migrating the site PLUS courses and user data, or are you creating a new empty site?

Where are you getting stuck?

  1. Have you copied the Moodle database across to the production environment?
  2. Have you installed and configured Apache (or IIS) on the production server?
  3. Have you installed and configured PHP on the production server?
  4. Have you copied the Moodle code across to the production server?
  5. Have you updated the Moodle config.php file with the correct production environment details?