Keywords: Moodle - Google Cloud Platform - Technical issue - Other
bnsupport ID:
a684b6a5-911c-824c-1af9-c337ee5e0f88
Description:
I have followed instructions from [here] (https://docs.bitnami.com/aws/how-to/migrate-moodle/) and [here] (Migrating moodle from old bitnami stack to new file structure).
I have migrated all of the files required across and I’m trying to get the instance to work.
When I’m accessing the instance, I get;
Error: Database connection failed
It is possible that the database is overloaded or otherwise not running properly.
The site administrator should also check that the database details have been correctly specified in config.php
I notice that the config.php of the old and new instance are slightly different.
The biggest thing I notice is the change from mysqli to mariadb and I feel that this may be the issue.
##New
<?php // Moodle configuration file
unset($CFG);
global $CFG;
$CFG = new stdClass();
$CFG->dbtype = 'mariadb';
$CFG->dblibrary = 'native';
$CFG->dbhost = '127.0.0.1';
$CFG->dbname = 'bitnami_moodle';
$CFG->dbuser = 'bn_moodle';
$CFG->dbpass = '41500c7038';
$CFG->prefix = 'mdl_';
$CFG->dboptions = array (
'dbpersist' => 0,
'dbport' => 3306,
'dbsocket' => '',
'dbcollation' => 'utf8_general_ci',
);
if (empty($_SERVER['HTTP_HOST'])) {
$_SERVER['HTTP_HOST'] = '127.0.0.1:80';
}
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
$CFG->wwwroot = 'https://' . $_SERVER['HTTP_HOST'];
} else {
$CFG->wwwroot = 'http://' . $_SERVER['HTTP_HOST'];
}
$CFG->dataroot = '/bitnami/moodledata';
$CFG->admin = 'admin';
$CFG->directorypermissions = 02775;
require_once(__DIR__ . '/lib/setup.php');
// There is no php closing tag in this file,
// it is intentional because it prevents trailing whitespace problems!