Moving Moodle site from shared hosting to VPS

Moving Moodle site from shared hosting to VPS

by Andre Nel -
Number of replies: 1

Hi, 

I need to move my moodle site from the shared hosting i have been using to a vps.  I have downloaded copies of moodledata, htt access (moodle files) and the database.  

I am using xampp.  I have put the moodle files in htdocs, and then also put the moodle data in the xampp folder and then i created a the database and imported the files.


I went into to config in moodle folder and edited as follows:

$CFG->dbtype    = 'mariadb';

$CFG->dblibrary = 'native';

$CFG->dbhost    = 'localhost';

$CFG->dbname    = 'pilotlry_mood547';

$CFG->dbuser    = 'pilotlry_mood547';

$CFG->dbpass    = '';

$CFG->prefix    = 'mdlax_';

$CFG->dboptions = array (

  'dbpersist' => 0,

  'dbport' => '',

  'dbsocket' => '',

  'dbcollation' => 'utf8_general_ci',

);


$CFG->wwwroot   = 'http://localhost/pilot';

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

$CFG->admin     = 'admin';

but when i try access the site, my browser times out and says site cant be reached


THanks in advance

Average of ratings: -
In reply to Andre Nel

Re: Moving Moodle site from shared hosting to VPS

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

I don't know why.

However, I would do this a little bit differently.

1) Install a clean copy of Moodle on your VPS that matches your shared hosting-Moodle version.

2) Add plugins to your VPS-Moodle to match your shared hosting-Moodle.

3) Delete all tables from your VPS Moodle, do a restore of your hosting-Moodle database backup to your VPS.

4) Delete the moodledata folder from your VPS, replace it with a backup of your hosting-Moodle moodledata folder.

5) Now that your new VPS has the data and moodledate contents from your old moodle, try logging into your new VPS-Moodle.

I cannot say that this is absolutely going to work for you.  It is just what I would try based upon how I move my own moodles around.  One needs to do things correctly for this process to work.  I also don't know if this would work if your two systems have different operating systems.  I am always in Linux when I do this.

I am offering ideas that might help you think through your own situation.