Deploying database changes: dev --> test --> prod

Re: Deploying database changes: dev --> test --> prod

by Emma Richardson -
Number of replies: 4
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

It is actually a wise thing.  You don't want to just randomly throw plugins, themes, settings over to a different site.  It is far wiser to install one plugin at a time and ensure that there are no issues.  You could replace the entire moodle folder (as long as it a version equal or newer than the production site) and then copy the config file from the production moodle folder to the new one.  That would bring in all your plugins at once but if you have any issues, then it will take you time to work out which plugin is causing the issue.

No two sites are really identical - especially when one is live as the database is changing daily.  So, even if there were no issues on the test site, it does not necessarily mean that it will go without issue on the production site.

In reply to Emma Richardson

Re: Deploying database changes: dev --> test --> prod

by Barton Hammond -

This is incredibly unsettling to me.  I just took an exhaustive amount of time learning how to setup Moodle and configure courses etc, and now I find that all the work I do on a dev/test environment has no easily defined, manageable and repeatable solution so that everything that is necessary to keep that environment in sync with the production environment is not available?  Am I understanding that I will have to figure out what all the changes were and basically reverse engineer the changes so that I can move them to prod?  What am I missing?  I expect to make changes in a dev/test environment and when everything is working and passed review, transfer those changes to prod so that the two systems are in sync. The only thing that would not be similar is the users.  Is there no automated solution to this?

In reply to Barton Hammond

Re: Deploying database changes: dev --> test --> prod

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

No.  I have not seen any CMS or LMS that has this option (not saying they don't exist but I use Wordpress Joomla etc with the same process.)  The problem is that the database is changing on both sites and there is no way to know which changes to keep or discard.

In reply to Emma Richardson

Re: Deploying database changes: dev --> test --> prod

by Yasser Farid -

Hi, actually I'm searching for the same solution you are discussing, soon we built E-Learning portal on our organization using Moodle over Bitnami stack and hosted locally on a production server, I was looking for a solution to have a similar test environment, for testing new (plugins, themes, courses,,,,etc.), then after reviewing and approval sync. it directly with production environment, as I understood there is no available tool doing that, so what are the main folders & files I have to copy from the test environment to the production one, to apply any new changes? thanks.

In reply to Yasser Farid

Re: Deploying database changes: dev --> test --> prod

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

That is the problem - it is not just files and folders.  You need to copy across any plugins you have installed or you can just reinstall them from the web installer within Moodle.  Then you need to set up any settings again on the live site because these settings are stored in the database and and files are buried somewhere deep in the moodledata folder.  Because both the moodledata folder and the database are updated continually by the live site there is no way to sync these two items.