Who can summarize a best practice for upgrading Moodle?

Who can summarize a best practice for upgrading Moodle?

by wz z -
Number of replies: 6

I deployed a Moodle server and some plugins, even with some unofficial plugins from Github. I have to modify some files to support Chinese, for example, PDF Chinese font and etc. So every time upgrading Moodle is really a challenge for me. I have to manually check folders in order not to override my third-party plugins and modifications to official Moodle codebase.

I suppose there must be some guys like me. So is there a best practice for such a common scenario?

Average of ratings: -
In reply to wz z

Re: Who can summarize a best practice for upgrading Moodle?

by Marina Glancy -
Picture of Core developers Picture of Moodle HQ Picture of Moodle Workplace team Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
We keep a separate git branch with all plugin (or even several of them), then separate git branch(es) with modifications to core and to plugins.
Every time you upgrade moodle (via git), you create a new production branch, pull the upgraded moodle code into it and then pull all your other branches on top of it.

This all requires good knowledge of git, of course.

Another thing I can recommend you is to think about how you can avoid core and plugin modifications. For example, if you are affected by some bug in core and keep re-applying a fix after each upgrade - why not submit the fix itself to moodle core? Maybe it's not even a functional bug but missing CSS classes that don't allow you to do styling you want. Or moodle uses the same language string for things that are different in your language - fix it in core and you'll help many other people. See https://docs.moodle.org/dev/Contributing_to_Moodle

Same thing with the plugins - send a pull request to the plugin developer.

Or maybe there is already a way to achieve your goal without hacking? Ask on forums, on plugin comments. Moodle codebase is huge, there are so many settings, one person can't possibly know about everything but the more people you ask the more options you'll find.
Average of ratings: Useful (1)
In reply to Marina Glancy

回复: Re: Who can summarize a best practice for upgrading Moodle?

by wz z -

@Marina, Would you please describe a whole detailed process of your git-based upgrading, esp, the git commands involved?

In reply to wz z

Re: 回复: Re: Who can summarize a best practice for upgrading Moodle?

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi wz z,

For detailed directions on setting up and using git, go to https://docs.moodle.org/32/en/Git_for_Administrators

As mentioned by Emma, you do need to make sure you are tracking the correct branch. It has been my experience that following these directions will leave alone all the plugins that I have added.

Average of ratings: Useful (1)
In reply to wz z

Re: Who can summarize a best practice for upgrading Moodle?

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

I have not yet mastered git (last time I set it up, I somehow ended up in the wrong branch and broke everything with my first upgrade!!) so I still upgrade manually.  I just pull up my plugins overview screen, filter to additional plugins and start copying.  I have 38 plugins - takes me about 1/2 an hour to get them all moved...

When I had core code hacks, I just kept a list of affected files and manually fixed them after the upgrade...actually I still have one or two that I have to do..

 

In reply to wz z

Re: Who can summarize a best practice for upgrading Moodle?

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

I only run 3 additional plugins, and since these are not maintained on GIT, I do my upgrades manually.  It is really not a big problem (once you have done it more than 100 times).  I do the complete upgrade (including first an experimental duplicate upgrade) in about 20 minutes.  My moodle is "down" for about 3 minutes.

Best practices?

1) Prep and experiment.

2) Go into maintenance mode.

3) Backup

4) Install

(I kind of skip step 3 since I have a cron job doing my complete backup each night.  Yep, could be a few changes between my regular backup and my upgrade.  The data is there, it is just if something crashes that I might lose a little data.  If I thought this might be an issue, I would do all four steps.)