Moodle installation unattended

Moodle installation unattended

by Juan Daniel Burró Aláez -
Number of replies: 7

I want to make an unattended installation of Moodle.  

We're using docker because we will have several installations (see GitHub repo https://github.com/juanda99/moodle-docker-production)

- Right now we create through code just database variables  so we generate the config.php and the installation screen goes to the test dependencies page. I think we have "jump" the admin/cli/install.php script (I'm pretty bad reading php).

We would like to insert all our data: moodle site, url, title site, language... and install it without human interaction.

I've seen this script in the admin cli:

-----

root@moodle:/var/www/html# /usr/local/bin/php admin/cli/install_database.php --help

Advanced command line Moodle database installer.

Please note you must execute this script with the same uid as apache.

Site defaults may be changed via local/defaults.php.

Options:

--lang=CODE           Installation and default site language. Default is en.

--adminuser=USERNAME  Username for the moodle admin account. Default is admin.

--adminpass=PASSWORD  Password for the moodle admin account.

--adminemail=STRING   Email address for the moodle admin account.

--agree-license       Indicates agreement with software license.

--fullname=STRING     Name of the site

--shortname=STRING    Name of the site

-h, --help            Print out this help

----

I guess I can execute it through code and then I'll have all my installation finished. Is it that way?

I would also like to install a theme and some plugins. Can it also be done unattended?

If not, I'm thinking about executing a complete installation and make a database export. For a new installation, use this backup and the search and replace tool 

Average of ratings: Useful (1)
In reply to Juan Daniel Burró Aláez

Re: Moodle installation unattended

by Ken Task -
Picture of Particularly helpful Moodlers

Yes, one could 'cobble together' something like you've described and you're kinda on the right track (competitor to Moodle Cloud and maybe even Moodle Spaces), but ... yep, here it comes ...

what you've described is but ..

Moodle releases code every week.  You might target 3.9.0 (not yet released) for your launch, but in a weeks time there is a 3.9.0+ ... following later ... a 3.9.1, then more point releases to follow - code + security fixes.

Hint: git

Quick story ... a gentleman familiar with Joomla discovered the installer for Joomla would allow an 'alt' import of an sql file which would set up a 'school'.  Admin person didn't have to build a lot to get a 'school' up and running.  Made a lot of $ ... initially ... but then came the 'support avalanche' and revisions of initial as well as forks!

Not everyone's 'school' had a single Elmentary, JH, and HS campus ... a reflection of a 'brick and mortar' .... is that the 'new normal' today?   Think about it and I'll stop there.

So a questions for you ... will you offer 'service after the sale' or will you turn over the site to a designated admin person from the entity ... then be available for 'consulting' ... or walk away?  And 'customers' are advised to come to this Moodle Community for support.

Are ya kinda re-inventing wheel?  Another BitNami but with Docker?

Not discouraging you here ... go forth!  But do think about giving back and or making your 'Docker+Moodle' available for others to use.

'SoS' ... NOCLAS ..., Ken


Average of ratings: Useful (1)
In reply to Ken Task

Re: Moodle installation unattended

by Juan Daniel Burró Aláez -
My code is available using the link I wrote in the first message of the thread.
I'll try to go along with the things I described above this week. It does not have any commercial purpose, it's more like getting the right tool for the job we have to do.
I'm also thinking right now how to upgrade Moodle, more issues to come!
Thank you!
In reply to Juan Daniel Burró Aláez

Re: Moodle installation unattended

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
'My code is available using the link I wrote in the first message of the thread.'
That gets you a lot of love from this Moodleista...
In reply to Juan Daniel Burró Aláez

Re: Moodle installation unattended

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Average of ratings: Useful (2)
In reply to Howard Miller

Re: Moodle installation unattended

by Juan Daniel Burró Aláez -
You mean use moosh for plugin and theme install using these commands?

moosh plugin-install --release 20160101 mod_quickmail
theme-settings-export && theme-settings-import

It sounds nice, because I won't need a database backup and plugin list could be configurable. Much better!
Do you know if plugins & theme get activated by default? I mean, is it completely unattended?
Thanks!
In reply to Juan Daniel Burró Aláez

Re: Moodle installation unattended

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Yes - it's completely unattended.

Also, it can set internal config settings, so you should be able to do all of the post-install configuration (e.g. setting your mail servers and so on)
Average of ratings: Useful (1)