Database problems migrating courses to new server

Database problems migrating courses to new server

by Nevin Reid -
Number of replies: 2
I'm in the middle of moving our current elearning site over to a completely new Moodle environment in the cloud. Currently we run it (version 3.0.4) on a Windows 2012 server using Apache. The new site is hosted on an Azure VM with Bitnami Moodle (ver 3.2.3). I'm new to this type of setup and have reduced access to servers now as they are mostly handled by our corporate IT department.

My problem is that when I backup our courses from the old setup and try to restore them on the new machine. I get an error when it tries to import the database. Specifically, after turning on debugging, it reports that the 'Moodle Column 'theme' cannot be null' in the user table.

Any suggestions on the best way to resolve this problem? It would much easier (ie, quicker if I don't have to get IT people involved) to resolve this on the old server. I was going to go into my database and modify the data field to have a non-null value but this box is still running production so I don't want to mess it up there.

Thanks in advance.


Average of ratings: -
In reply to Nevin Reid

Re: Database problems migrating courses to new server

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

I'm not clear what you are doing. 

How are you 'importing' data from one database to another. You can do that but you need import the whole thing and allow the tables to be created from the SQL dump as well. Otherwise, you are trying to import data into a database with (potentially) a different schema from that in which the data was created. This is likely as the Moodle versions are different. 

Personally, I wouldn't use an installer like Bitnami either. Only ever download your Moodle code from moodle.org

In reply to Nevin Reid

Re: Database problems migrating courses to new server

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

I agree with Howard - if you are setting up a new environment, you will be a lot better off to get rid of the bitnami version and start with a fresh version manually installed.  This is just going to give you headaches as you move forward and might even be the cause of this issue too.

Back to your problem though.  I suspect on the new moodle, you might have either course or user themes enabled and these were not enabled on the old moodle.  Try turning that setting off while you restore your courses.