New Installation with existing DB and Config shows Installation

New Installation with existing DB and Config shows Installation

by Evan K -
Number of replies: 1

When installing Moodle, it is known that the database is created and the config.php file is also created. For that reason, it is my expectation that we can use an existing fresh Moodle database created by an installation and the already created config.php to set up a working instance of Moodle without the Installation process running.

However, when I try to do this, by unzipping the installation, and placing my config.php into it, the installation still appears and asks for Database information. Is there some other file that I need to add/remove to indicate to the app that it does not need to do the installation step?

My version is 3.8.1 and I'm using the below config.php (with sensitive data like host/password redacted):

<?php  // Moodle configuration file

unset($CFG);
global $CFG;
$CFG = new stdClass();

$CFG->dbtype    = 'pgsql';      // 'pgsql', 'mariadb', 'mysqli', 'mssql', 'sqlsrv' or 'oci'
$CFG->dblibrary = 'native';
$CFG->dbhost    = 'REDACTED';  // eg 'localhost' or 'db.isp.com' or IP
$CFG->dbname    = 'moodle';     // database name, eg moodle
$CFG->dbuser    = 'moodleuser';   // your database username
$CFG->dbpass    = 'REDACTED';   // your database password
$CFG->prefix    = 'mdl_';
$CFG->dboptions = array (
  'dbpersist' => 0,
  'dbport' => 5432,
  'dbsocket' => '',
);

$CFG->wwwroot   = 'REDACTED';
$CFG->dataroot  = '/var/www/moodledata';
$CFG->admin     = 'admin';

$CFG->directorypermissions = 0777;

require_once(__DIR__ . '/lib/setup.php');

// There is no php closing tag in this file,
// it is intentional because it prevents trailing whitespace problems!


Average of ratings: -