Installing different versions of Moodle on the same local computer

Installing different versions of Moodle on the same local computer

by Mike Smith -
Number of replies: 11
Dear Moodle Installation Experts,

Is it possible to install different Moodle versions (namely 4.3, 4.2, 4.1, 3.11, 3.7 and 3.3) on the same computer and give them different localhost port numbers? 

If yes, is there a guide on how to do it?

My manager wants to test the plugins on different Moodle versions as our company has a wide variety of different versions of Moodle running on our servers, so I am thinking I would need them on the local computer.

Thanks!

Mike
Average of ratings: -
In reply to Mike Smith

Re: Installing different versions of Moodle on the same local computer

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
Yes is the short answer. I use Mamp Pro which makes it extremely easy to install multiple versions for testing..
Average of ratings: Useful (1)
In reply to Emma Richardson

Re: Installing different versions of Moodle on the same local computer

by Mike Smith -
Hi Emma,

Thank you for the feedback. Is your local Moodles on Windows or Mac?

Mike
In reply to Mike Smith

Re: Installing different versions of Moodle on the same local computer

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
Mine are on a mac. I know a lot of Windows users use Xamp. I just installed linux via WSL2 on a windows box and I am loving it. Have not set up multiples on it yet but it should just be a matter of creating virtual hosts in apache for each version.
In reply to Mike Smith

Re: Installing different versions of Moodle on the same local computer

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
I have both MAMP and XAMPP installed on my Mac (in various ways) for experimentation, which is my preferred way of experimenting with Moodle. Like Emma, I use MAMP almost all the time.

If you have Moodle installed on your server, you can also install extra versions of Moodle. However, be careful about naming. For example, one might have...

moodle, moodle.sql, moodledata
moodle4, moodle4.sql, moodledata4
moodle33, moodle33.sql, moodledata33
moodle311, moodle311.sql, moodledata311

If you are new to Moodle, be extremely careful about experimenting on your production server. This is why I prefer experimenting on my MAMP.

Also, you must be careful about your PHP and database versions, ensuring they match the specific Moodle version requirements. For the Moodles you mentioned, I can run these in my MAMP with MySQL 5.7.34 and PHP 8.0.8.
In reply to Mike Smith

Re: Installing different versions of Moodle on the same local computer

by Ken Task -
Picture of Particularly helpful Moodlers
Hey, @ Mike ... Emma and Rick say they have done what you seek to do ... but they have not given any details as to how.   Guess they figure that you can figure it out. :|

I got an idea ... @Mike ... ASK THEM HOW! smile

'SoS', Ken

In reply to Ken Task

Re: Installing different versions of Moodle on the same local computer

by Ken Task -
Picture of Particularly helpful Moodlers
Got another suggestion ... use a Mac ... AND install git.   That's easy to do.

But here's the twist ... make it a total learning platform.   With git one can learn how to side load the git repo into code directories that were acquire by downloading zips and unzipping.
One could also learn how to update a versions point release.

Or even 'march' a 3.6 to 4.3 via git and the scripts in admin/cli/.

And here's one for ya ... if on the same machine, one could create a 'unirepo' file system.
Each version has a file system setup pointed to that same 'unirepo' directory outside of any of the moodledata directories.   

Why do that?   One could make course backups of 3.6 version and save to a 36 subdirectory in 'unirepo'.   In the 4.3 version it would have the same 'unirepo' file system setup and it could restore 3.6 course backups to the 4.3 ... just for grins! - so it's server to server ... not 'download' only to have to turn around and 'upload'. smile

Fun and games ... blow your feeble! smile

'SoS', Ken

In reply to Ken Task

Re: Installing different versions of Moodle on the same local computer

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
Yes, ask us how. At this point, I am unsure what your level of experience is with Moodle. For example, do you have a Moodle up and running and now want to install different versions? Or is this a hypothetical question, and just probing?
In reply to Rick Jerz

Re: Installing different versions of Moodle on the same local computer

by Ken Task -
Picture of Particularly helpful Moodlers
Judging from Mr. Smith's postings in moodle:
https://moodle.org/mod/forum/user.php?id=5690757&course=5

I'd say Mr. Smith has experience ... and does have several moodle servers.

This very thread ... began with:
https://moodle.org/mod/forum/discuss.php?d=453538#p1822429
"Moodle versions as our company has a wide variety of different versions of Moodle running on our servers"
(namely 4.3, 4.2, 4.1, 3.11, 3.7 and 3.3)

I would ask ... 'What level of experience is required?' ... but I won't.

Got another idea, however ... hmmmm ... put this 'how-2' in a moodle course - hmmmm - a moodle about about moodle!!!! (imagine that!).    And, in that how-2 as an additional feature .. provide a link to the backup of that course so users can install it on their own moodle!    As changes are needed to course content, they, by then, can make them in their own course!  

Or, maybe even ... best yet, make use of moodle 'sharing'! (covers all of Mr. Smiths versions!)


or


'SoS', Ken


In reply to Mike Smith

Re: Installing different versions of Moodle on the same local computer

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
I use various versions of small board computers, Odroid XU4's, Raspberry Pi's 3 and 4's, and also Orange Pi 5's. Using them I can make the Moodle sites available on my intranet 24/7 and thus available even when my local computer is turned off. Right at the moment I use multiple versions of Operating systems and Databases, to make sure the plugins I maintain work as expected. I currently have at least one installation from Moodle 1.9.19+ all the way to Moodle 4.3 and even the development version, Moodle main. I typically run multiple Moodles on each SBC as simple subdomains, and they are usually on one of the SBC's based on which PHP and Database version I have installed.

All I do ahead of time, with phpMyAdmin, is to create the user, password, and database. I then use git to create the subdomain folder and install the code. I then open a web browser in the subdomain (IP/subdomainfoldername) which will invoke the install.
In reply to Mike Smith

Re: Installing different versions of Moodle on the same local computer

by Ken Task -
Picture of Particularly helpful Moodlers
Seems to be 'one way street' with Mr. Smith.   And no follow up ... ever!
Sooo ... outta here! And forever with any 'one way streeter' :|