Move Moodle from remote server to local WAMP server

Move Moodle from remote server to local WAMP server

by Zoltan Ordog -
Number of replies: 9

Hello!

How to move/copy a whole moodle site from remote to a local WAMP server. I already installed the WAMP server on my windows machine, already downloaded via ftp the whole moodle site. Now I'm on the installing part of moodle, and I don't know what settings should I made to connect somehow the downloaded moodle with the local one.

I should install first a new moodle site on my local WAMP server ?  or when I'm installing the moodle ...should I make some modifications in the installing steps or some configuration files ? Or I should export from my remote website a database file, then somehow import that file in the new installation?

Please help me 


Kind regards

Zoltan

Average of ratings: -
In reply to Zoltan Ordog

Re: Move Moodle from remote server to local WAMP server

by Colin G -

First you need to copy the moodle web root to your wamp web root. Then you need to copy the moodle data directory. Set permissions on the 2 directories and edit the moodle config to point to the 2 correct locations.

Then you need to dump the remote moodle database and import the .sql file  to your local mysql server.

In reply to Colin G

Re: Move Moodle from remote server to local WAMP server

by Zoltan Ordog -

Thank you ! 

It's working almost everything, except the images and the swf-s not loading .....I think because I don't know how to : "Set permissions on the 2 directories " on windows 7 ...please can you explain me ? 




In reply to Zoltan Ordog

Re: Move Moodle from remote server to local WAMP server

by Zoltan Ordog -

I did the necessary modifications in the moodle config file,then I changed the http://mydomain.com  with http://localhost/moodle   in all the database, but the images and the swf-s  they are not loading ....? 

The admin portion is working perfectly, I can create users , I can change everything I want , The css was correctly imported ......but the course material and teh images from the frontpage are little blank icons. 


In reply to Zoltan Ordog

Re: Move Moodle from remote server to local WAMP server

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

You need to run the replace tool found at admin/tools/replace/index.php.  This will update the urls stored in the database to point towards your new url.

In reply to Emma Richardson

Re: Move Moodle from remote server to local WAMP server

by Zoltan Ordog -

Yes...I already did this too... but still no images and videos....sad

I should run the replace tool for the moodledata folder too ?   And if yes ... then how ?

In reply to Zoltan Ordog

Re: Move Moodle from remote server to local WAMP server

by Colin G -

Is the path to the image files correct ?

If not you could run an sql query on your moodle database to fix the paths.

In reply to Colin G

Re: Move Moodle from remote server to local WAMP server

by Zoltan Ordog -

First of all I can't find the images path folder ...where is located this folder in moodle and what is the name of this folder and how  can I run an sql query on my moodle database to fix the paths for these images and swf course materials ?

In reply to Zoltan Ordog

Re: Move Moodle from remote server to local WAMP server

by Colin G -

Hi. If you view the image location in your browser it should show you the path to the image or swf file. Assuming that is not correct you would need to fix them but I would have to see your moodle installation.

It may just be a matter of creating a sym link in your filesystem that points the old location to the new location.

In reply to Colin G

Re: Move Moodle from remote server to local WAMP server

by Zoltan Ordog -

The content of moodle (only the content) folder is copied in the C:\wamp\www folder, the moodledata folder is copied like this : C:\wamp\www\moodledata 

The config file is :

<?php  // Moodle configuration file


unset($CFG);

global $CFG;

$CFG = new stdClass();


$CFG->dbtype    = 'mysqli';

$CFG->dblibrary = 'native';

$CFG->dbhost    = 'localhost';

$CFG->dbname    = 'databasename';

$CFG->dbuser    = 'username';

$CFG->dbpass    = 'password';

$CFG->prefix    = 'mdl_';

$CFG->dboptions = array (

  'dbpersist' => 0,

  'dbsocket' => 0,

);


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


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

ini_set('error_log', $CFG->dataroot . '/log/error.' . date('Y.m') . '.log'); // error_log( "Hello, errors!" );

$CFG->admin     = 'admin';


$CFG->directorypermissions = 0777;


$CFG->passwordsaltmain = 'TnFvJpvL<fkA7i3zn=W_[0s$~';


$CFG->phpCourseEnable = array(); // MelcomSW modification for php file execution

$CFG->phpCourseEnable[1440] = 1;

$CFG->phpCourseEnable[1517] = 1;


require_once(dirname(__FILE__) . '/lib/setup.php');


// There is no php closing tag in this file,

// it is intentional because it prevents trailing whitespace problems!



Like I said before , everything is working the css, the administrator panel ....only the images and the swf-s course material is not loaded ...

That sym link creation in my filesystem can you explain me how to do it