migration help

migration help

by Anitha Moodle -
Number of replies: 11

Hi all

I am migrating my site to a new domain name. I loaded public_html and moodledata and changed the config.php to the new url.

Still site not working . Is there anything I missed out.

Average of ratings: -
In reply to Anitha Moodle

Re: migration help

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
What does not working mean?
In reply to Emma Richardson

Re: migration help

by Anitha Moodle -

http error 500

In reply to Anitha Moodle

Re: migration help

by Anitha Moodle -
I am using version 1.9 and is it the following directory structure works in the root folder

public_html
moodledata

Also attached the config file
<?php /// Moodle Configuration File

$CFG = new stdClass;
$CFG->dbtype = 'mysql';
$CFG->dbhost = 'localhost';
$CFG->dbname = 'dbname';
$CFG->dbuser = 'dbuser';
$CFG->dbpass = 'pass*';
$CFG->dbpersist = false;
$CFG->prefix = 'md_';

$CFG->wwwroot = 'http://www.mysite.net';
$CFG->dirroot = '/home1/course/public_html';
$CFG->dataroot = '/home1/course/moodledata';
$CFG->admin = 'admin';

$CFG->directorypermissions = 00777; // try 02777 on a server in Safe Mode


require_once("$CFG->dirroot/lib/setup.php");

?>
In reply to Anitha Moodle

Re: migration help

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Moodle 1.9? Really?

That's very, very obsolete.

Regardless, your config settings look believable. 
In reply to Anitha Moodle

Re: migration help

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
As Howard said, you are using such an old version. Could be a multitude of issues. Ken has given you some places to start looking. Have you set up the dns with your host/on your server? I hope this is the start of an upgrade path!!
In reply to Anitha Moodle

Re: migration help

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Do you mean, you have a running Moodle 1.9 site and moved it to another server? Then the documentation is here: https://docs.moodle.org/19/en/Moodle_migration.

You need to make sure that the system software of the new server, the LAMP stack for example, are compatible with Moodle 1.9. During those 11+ years since the release of 1.9 the system software have moved forward. BTW, I maintain their history in this table: http://www.syndrega.ch/blog/#php-and-dbms-compatibility-of-major-moodle-releases. Be warned: The table is "continuously under construction". No guarantee whatsoever! Feedback is welcome!

Well about the 500 Error. You can also create a test.html file in the moodle directory (next to config.php) and visit http://www.example.com/test.html in the browser. You should see the content of test.html.
In reply to Anitha Moodle

Re: migration help

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Check your web server's error log. You should find the 500 error and it should give more detail.

Even better, switch on Debugging in your config.php
In reply to Anitha Moodle

Re: migration help

by Ken Task -
Picture of Particularly helpful Moodlers

Migrations could be to a new server ... thus new environment.   Is that what you are doing?  or are you just changing the domain name? 

One had to transfer the contents of public_html (the moodle code) and moodledata + moodledb sql dump imported).  If you transferred code and moodledata ... if you used FTP to transfer, did you use binary mode in FTP?

Changing the domain name (FQDN) would also mean two other steps ... 1. the  config.php file edits and 2. search and replace in the database for http://olddomain/ replace with http://newdomain/

Version 1.9.x did not have an admin tool to do the FQDN conversions in the DB.  That had to be accomplished by editing the SQL dump of old site DB and doing a search and replace on the SQL dump file, before importing into the new database on the new environment.

Make sure you edit the config.php file with a text editor ... not word or any other word processor.  There could be machine language symbols/characters in your config.php file that you do not see that's causing error 500's.

And last, but not least, the clip you've shown of your config.php file ... ** make sure ** there are no additional blank lines after the closing php tag in that file.

Unless I just totally mis-read .... :|

'SoS', Ken


Average of ratings: Useful (1)
In reply to Ken Task

Re: migration help

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi Ken

About the FQDN conversion: If the replace tool was not there earlier, it arrived soon with 1.9. See Re: Changing moodle URL - lost all pictures and files, Jan 2007!
In reply to Visvanath Ratnaweera

Re: migration help

by Anitha Moodle -
Thanks for all your replies,
Here is my new config file,
<?php /// Moodle Configuration File


$CFG = new stdClass;
$CFG->dbtype = 'mysql';
$CFG->dbhost = 'localhost';
$CFG->dbname = 'xxx';
$CFG->dbuser = 'xxx';
$CFG->dbpass = 'xxx*';
$CFG->dbpersist = false;
$CFG->prefix = 'md_';

$CFG->wwwroot = 'http://mysite/courses';
$CFG->dirroot = '/home1/fld/public_html/courses';
$CFG->dataroot = '/home1/fld/public_html/courses/moodledata';
$CFG->admin = 'admin';

$CFG->directorypermissions = 00777; // try 02777 on a server in Safe Mode

require_once("$CFG->dirroot/lib/setup.php");
// MAKE SURE WHEN YOU EDIT THIS FILE THAT THERE ARE NO SPACES, BLANK LINES,
// RETURNS, OR ANYTHING ELSE AFTER THE TWO CHARACTERS ON THE NEXT LINE.
?>

*******************************
with the above config file, I have all folders in place but still I am getting 500 error.

In reply to Anitha Moodle

Re: migration help

by Ken Task -
Picture of Particularly helpful Moodlers

Error 500's don't show much via web but your servers error logs will provide some clues.  Could we see a clip of what some of those error log line say?

Also, to get more info from moodle (if possible), Section 7 of config-dist.php shows how to turn on debugging by adding debug lines to the config.php file.

Add those lines and let's see what moodle might saying.

Also, is this line:

$CFG->wwwroot = 'http://mysite/courses';

in your config exactly as you shared here ... or are you hiding your server's URL?   Hiding ok here in forums as long as 'mysite' represents a fully qualified domain name of server that can be resolved via DNS.

It won't hurt to mention versions of Moodle involved ... found by looking at version.php file at the moodle code root.

'SoS', Ken