Install Moodle - Ubuntu with MSSQL Server 2012 DB

Install Moodle - Ubuntu with MSSQL Server 2012 DB

by Rene Ouellette -
Number of replies: 10

Hi All,

Just wondering if anyone has some documentation on having Moodle installed on Ubuntu 14.04 and using MSSQL server 2012 on the backend.

I have taken a couple runs at getting it running with FreeTDS, but can't seem to get it to work.   The database is in a named instance, which may complicate the issue.  Tried Googling the FreeTDS install and there seems to be a lot of different ways of setting up the driver.  Not really sure what is all required.

Thanks for any help,

Rene

Average of ratings: -
In reply to Rene Ouellette

Re: Install Moodle - Ubuntu with MSSQL Server 2012 DB

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

You could always just run MySQL or PostgreSQL... which will take about 10 minutes. It's not like you don't have Linux experience...

In reply to Howard Miller

Re: Install Moodle - Ubuntu with MSSQL Server 2012 DB

by Rene Ouellette -

Hi Howard,

It is true, and we having been running with the MySQL database for years now.   We are just looking at integrating Moodle with our SIS, and it would potentially simplify integration running the systems on the same backend.

I suspect as more and more Colleges run Moodle, and look for this integration, installations on SQL Server or Oracle will become more prevalent.

Rene

In reply to Rene Ouellette

Re: Install Moodle - Ubuntu with MSSQL Server 2012 DB

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

Hmmm.... my advise is to continue to run Moodle on MySQL and your SIS on SQL Server (their native databases). The rest is just connecting it up. Consider scripting something to create a nightly feed/dump from your SIS to MySQL table/tables on your Moodle server. You might even harness Moodle's web services depending what facilities you have available. 

I'm not saying you can't run Moodle on SQL Server or indeed Oracle. You just don't want to. Neither are Moodle's primary development database and you're just making trouble for yourself. 

In reply to Rene Ouellette

Re: Install Moodle - Ubuntu with MSSQL Server 2012 DB

by Bret Miller -
Picture of Particularly helpful Moodlers

It is quite simple to install the MySQL driver on your MSSQL server and create a linked server to access your Moodle data from the MSSQL database.

In reply to Rene Ouellette

Re: Install Moodle - Ubuntu with MSSQL Server 2012 DB

by Rene Ouellette -

Hi Gents,

We may end up staying with MySQL and using programming to do exactly as you suggest.  We are just exploring some possibilities, and I wanted to have a direct Moodle connected to MS Sql to see how it runs.


Will look into both suggestions.

Thanks,


Rene

In reply to Rene Ouellette

Re: Install Moodle - Ubuntu with MSSQL Server 2012 DB

by Rene Ouellette -

Was able to get Moodle attached to MS SQL server named instance.


Firewall needed UDP 1434 and the TCP port for the named instance.

Was able to track down the port for the named instance using TSQL -LH "serverfqdn"


Freetds.conf 


text size = 20971520


# A typical Microsoft server

[connection name]

        host = server.fqdn

;       port = 1433 -- commented out port

        instance = instancename

        tds version = 8.0

        client charset = UTF-8


Ran the install of Moodle, and selected MSSql as the db driver to use.

In reply to Rene Ouellette

Re: Install Moodle - Ubuntu with MSSQL Server 2012 DB

by Luis de Vasconcelos -
In reply to Luis de Vasconcelos

Re: Install Moodle - Ubuntu with MSSQL Server 2012 DB

by Rene Ouellette -

Hi Luis,


I changed the tds version to 7.3, and it would not connect to the database.  Reverted to 8.0 and it works.


Error shown on page when set to 7.3:  Config table does not contain version, can not continue, sorry.


Confirmed that TDS Version 7.1 and 7.2 work.   SQL Server 2012 uses TDS 7.4, so this may be the issue.


Thanks, Rene

In reply to Rene Ouellette

Re: Install Moodle - Ubuntu with MSSQL Server 2012 DB

by Luis de Vasconcelos -

Which version of FreeTDS are you using?

Since 7.3 doesn't work, what happens when you use 7.4?

tds version = 7.4

Coincidentally, Frediano Ziglio, one of the main FreeTDS developers posted a message on the [freetds] list yesterday saying that we should not use 8.0 and that it will be removed in the next version of FreeTDS. See: http://lists.ibiblio.org/pipermail/freetds/2015q3/029468.html

Have you set the TDSVER environment variable? It overrides the 'tds version' in the freetds.conf file.


In reply to Luis de Vasconcelos

Re: Install Moodle - Ubuntu with MSSQL Server 2012 DB

by Rene Ouellette -

Hi Luis,

I tried 7.4 and it doesn't work.   FreeTDS supports 7.1 and 7.2, so I guess that is why anything higher doesn't work.

It is version .91

I didn't set the TDSVER variable.