Linking 2 Moodle Databases

Linking 2 Moodle Databases

by Stephan Fourie -
Number of replies: 4

Good Day


I would like to know if the following scenario is possible to roll out.


I have two moodle installations, one is hosted trough my ISP and the other is hosted locally on a server that is connected to my internal network that is not accessible trough the internet.


I currently use the local instance to develop courses, I then have to make back ups and then restore the backups to the hosted installation.


So here is my question, is it possible to link the two instances databases together so that when development of new courses has been done I am able to sync the the DB's and roll out the changes to the hosted installation.

Also, the student enroll trough the hosted version and would want that to update back to the local instance. 

Average of ratings: -
In reply to Stephan Fourie

Re: Linking 2 Moodle Databases

by Stephan Fourie -

Basically forming an exchange between the two.

In reply to Stephan Fourie

Re: Linking 2 Moodle Databases

by Usman Asar -
Picture of Plugin developers Picture of Testers

Absolutely possible, but before doing that, as you mentioned you are making courses on localhost and uploading, is there any issue in that? as this being easier and better way to upload courses.

regarding your query, you'll be creating a MASTER <-> MASTER Replication of your databases, but the issue is, when you create replication, not just courses, but as well all other inputs like forum posts, messages, chat sessions etc will be imported  onto your local database, that is why I had asked if you cannot just upload the courses. In other words, the remote site must be an exact replica of your local site in terms of what blocks you are using, what themes you have applied, what plug-ins you have installed etc etc.

If you want to go this path of replication, let me know, I'll tell you how to do that. Just be ready with following things:

1: Dedicated IP address from your ISP
2: port 3306 (or whatever you are using) opened at your firewall/router
3: PHPMyAdmin installed and working at both ends

In reply to Stephan Fourie

Re: Linking 2 Moodle Databases

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 are getting some positive answers, however, synchronising two Moodle sites is NOT actually possible. 

If all you want to do is to create courses locally and then 'publish' to your production site then you can use backup and restore. 

Average of ratings: Useful (1)