SOS please ... Can 2 Moodle sites share one Moodle database?

SOS please ... Can 2 Moodle sites share one Moodle database?

by leili mei -
Number of replies: 4

Hi.  I am not sure if this is the right forum to ask this.

Recently I installed Moodle (version 3.8) using a particular domain.  We are thinking of creating a subdomain for Moodle (version 3.9) in a different domain.  Since we are allowed limited number of database by our hosting service, I would like to know if it is possible that 2 Moodle sites can share the same database so that I won't have to create another database.

Hope somebody can help.

Thanks.



Average of ratings: -
In reply to leili mei

Re: SOS please ... Can 2 Moodle sites share one Moodle database?

by Ken Task -
Picture of Particularly helpful Moodlers

Possible .. if the second instance uses a different prefix, but ... it does make admin of both a liltle more troublesome if either site has issues related to database ... actually, doing above could cause issues with both sites at once. :|

Think you'd be better off using a separate DB.

Much has to do with type of hosting ... shared ... is becoming very problematic for higher versions of Moodle and for admins who don't have access to tweaks for DB server, etc.

'SoS', Ken

In reply to Ken Task

Re: SOS please ... Can 2 Moodle sites share one Moodle database?

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Yes you can do it, each site can be installed with a different db prefix, i.e. mdl_user and mdl2_user
but If your hosting is limiting the number of databases I recommend moving hosts to one that does not include that limitation.
Limiting the numbers of databases brings no obvious benefit to the hosting organisation, but some minor ones to you, such as you cannot do a simple database dump of only one moodle.
Average of ratings: Useful (1)
In reply to Marcus Green

Re: SOS please ... Can 2 Moodle sites share one Moodle database?

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
yeah - don't do it.. the likelihood is that you're on a really cheap web-host which probably isn't designed to run 1 Moodle site - let alone 2 on the same plan. Upgrade your web-host plan and give your host a bit more $$ - or move to a more expensive host that might have a bigger capacity.

Moodle really isn't designed to cope well on these shared/cheap web hosts. Don't expect it to perform well - if you're looking for a cheap option that performs well, then look at MoodleCloud.com
In reply to Dan Marsden

Re: SOS please ... Can 2 Moodle sites share one Moodle database?

by leili mei -
Thanks for all your replies... the thing is once I finished installing the other site with Moodle, we will no longer use the other site with existing Moodle... that´s why I was thinking of using the same database... will this do? Thanks again.