Installer page moodle after migration

Installer page moodle after migration

by Matteo Kutufà -
Number of replies: 6

Hi All,

This is my first post and after a search without success I take courage to write here my issue with Moodle 3.8.1

I made a migration of a production Moodle installation from the production server on a backup/standy server. I used the "quick and dirty" method and i made this steps:

1) rsync from source to destination server (folder's path is the same on both servers)
2) mysqldump from source server;
2.a) search in sql file of all refereces of the old FQDN (eg. moodle.example.com) and a massive replace using new FQDN (bck-moodle.example.com);
2.b) SQL import of the modified sql file into destination server;
3) modified the config file adjusting with new parameters and references;

After all, browsing the url https://bck-moodle.example.com moodle don't show the home page but the installer page.

I made a check on all configurations, files, sql, etc but I wasn't able to solve this issue.

Someone have any idea about this problem?

Last note: on source server everything works fine and all prerequisites are validated. The destination server is a specular clone of the source server (same hardware, same Linux Distribution and version, same php packages installed, same Apache versions and modules...

Thank you!

Matteo

Average of ratings: -
In reply to Matteo Kutufà

Re: Installer page moodle after migration

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

Depending on which install page you see I think Moodle cannot find either 1) config.php, 2) the database defined in $CFG->dbname on server $CFG->dbhost, or 3) any tables within this database.

Look in config.php for the database settings, e.g.:

$CFG->dbhost    = 'localhost';
$CFG->dbname    = 'moodle_backup';
$CFG->dbuser    = 'moodle_user';
$CFG->dbpass    = 'yourpassword';

Then try to connect to the database using the above settings, e.g. mysql -u moodle_user -p -h localhost moodle_backup.

Then see if any of the tables exist, e.g. SELECT * FROM mdl_user or SELECT * FROM mdl_config (assuming $CFG->prefix is 'mdl_').

If you're still having problems, post a screenshot of the install page (hide any information you don't want to share).

Also: for your step 2. a) Moodle has a database search and replace tool.

In reply to Leon Stringer

Ri: Re: Installer page moodle after migration

by Matteo Kutufà -
Hi Leon,
Thank you for your reply.
config.php is correct and db it's ok and accessible by the user with the password configured in config file.
As you requested i attached the screenshot of the installation page that i have browsing the FQDN.

Regards
Mk
Attachment installer.jpg
In reply to Matteo Kutufà

Re: Ri: Re: Installer page moodle after migration

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

"config.php is correct and db it's ok and accessible by the user with the password configured in config file"

Unfortunately, if that were true you wouldn't be looking at the install page. 

In reply to Matteo Kutufà

Re: Ri: Re: Installer page moodle after migration

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

For that page to appear Moodle has successfully connected to the database but did not find the expected tables.

First Moodle looks for any tables with SHOW TABLES LIKE '{$CFG->prefix}%'. So if $CFG->prefix is 'mdl_' this statement is SHOW TABLES LIKE 'mdl_%'. Do you get tables listed when you run this?

Then Moodle looks for three specific tables: mdl_config, mdl_course and mdl_groupings (again assuming 'mdl_'). Do these tables exist?

If it's still not working then re-check that you're looking at the correct database server ($CFG->dbhost). If you want to trace the source code then the above table check starts in admin/index.php probably line 203:

203 if (!core_tables_exist()) {
   ⋮
224         echo $output->install_licence_page();
In reply to Leon Stringer

Ri: Re: Ri: Re: Installer page moodle after migration

by Matteo Kutufà -
Leon,
First of all thank you for your support.
All your suggestions made me a re-check of everything in files, db and configuration.
Everything, as already I said, are ok but the problem is the MySQL username: I inherited this Moodle installation and had to proceed to a standby copy
In detail the user have a . "dot" inside its name. This particularity don't generate any kind of problem on an older version of MySQL but with MySQL 8.x generate the problem.
I have create a new user without any singularity in its name, assigned correct grants and now everything works like a charm.
Again, thank you for everything!
In reply to Matteo Kutufà

Re: Ri: Re: Ri: Re: Installer page moodle after migration

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Oddly, I was reading about a similar problem just yesterday (not related to Moodle) about somebody who had a dash (-) in the database name. Same issue.

One to watch out for.