Hi
I'll try to keep this as straight to the point as I can, but I do ramble a bit
So a bit of background information. All of our Moodle experts have left our company and we need to move our MSSQL DB from a 2008 R2 Server to a 2016 instance on a different DB server. My post here https://moodle.org/mod/forum/discuss.php?d=387570 was help with the migration of the DB.
Now before I do that I wanted to understand how Moodle works, so I was looking at the setup for our Moodle Test system. Now when I load up my test URL I get the below error:
Error reading from database
My config.php file is pointing to our new Windows 2016 MSSQL Test Database Server instance (before it was on a dedicated server) - below is the DB extract from my config.php file but I have changed the private information.
//=========================================================================
// 1. DATABASE SETUP
//=========================================================================
// First, you need to configure the database where all Moodle data //
// will be stored. This database must already have been created //
// and a username/password created to access it. //
$CFG->dbtype = 'mssql'; // 'pgsql', 'mariadb', 'mysqli', 'mssql', 'sqlsrv' or 'oci'
$CFG->dblibrary = 'native'; // 'native' only at the moment
//$CFG->dbhost = 'dbserver1.website.org.uk'; // eg 'localhost' or 'db.isp.com' or IP
//$CFG->dbhost = 'dbserver2.website.org.uk';
$CFG->dbhost = 'new2016testserver.website.org.uk';
//$CFG->dbhost = '.website.org.uk';
$CFG->dbname = 'MoodleTest'; // database name, eg moodle
//$CFG->dbname = 'changed'; // database name, eg moodle
$CFG->dbuser = 'thishasbeenchanged'; // your database username
$CFG->dbpass = 'ihavechnagedthis'; // your database password
$CFG->prefix = 'mdl_'; // prefix to use for all table names
$CFG->dboptions = array(
'dbpersist' => false, // should persistent database connections be
// used? set to 'false' for the most stable
// setting, 'true' can improve performance
// sometimes
'dbsocket' => false, // should connection via UNIX socket be used?
// if you set it to 'true' or custom path
// here set dbhost to 'localhost',
// (please note mysql is always using socket
// if dbhost is 'localhost' - if you need
// local port connection use '127.0.0.1')
// 'dbport' => 'oldportnumber', // the TCP port number to use when connecting
'dbport' => '1433', // the TCP port number to use when connecting
// to the server. keep empty string for the
// default port
The DB server is in one DMZ on our network and the Application/Webserver in another. Firewall rules have been created between the app server and the SQL instance on the DB. We can telnet from the app server to the DB Server on the port and we have even created an ODBC connection on the App Server to the DB Server using the DB username and password and it connects through without an issue.
I read somewhere on the forums about someone using 1433 as the port in the config and spoof it to the real DB port, but my Network guys thing we shouldn't have to do that (please note: the config file has port 1433 and the open DB port set but the same error shows)
We are running Moodle version 3.1 (Build: 20160523) on Windows 2012 R2
I would like to get this up and running and familiarise myself before I move our Live DB to a new instance on a DB Server
I Hope I haven't forgotten anything.
Thank you