As you've found, demo.moodle.org redirects to demo.moodle.net as our security expert Petr recommended that a demo site providing admin access should be on a different domain from moodle.org.
The demo site is upgraded and content edited / added to by making use of a restricted access demo master site (which is not wiped clean every hour). The demo master site is updated and then copied to the live demo site. The same process is used for updating http://school.demo.moodle.net/ and for http://qa.moodle.net/.
Sorry I've no idea how intensively the site is used, though usually when I look at it there are new courses and often the theme has been switched, so it seems people appreciate the chance to have a play.
I'm trying to setup my own demo moodle site that would reset back to a clean state on the hour or nitely like yours.
How is this done? CRON, Scripted..
I have full root access on WHM and cPanel.
Any directions are greatly appreciated.
I had to do something very similar. Here is my solution. Please note that this is a quick trick which worked for my setup. Think of it as a documentation of the necessary steps. DON'T just repeat them, you'll find your site wiped out!
There is an active Moodle instance with the following config.php in my server (the values in capitol letters are withheld for you to substitute):
$CFG->dbtype = 'mysql';
$CFG->dbhost = 'localhost';
$CFG->dbname = 'MDLDB';
$CFG->dbuser = 'MDLUSER';
$CFG->dbpass = 'SECRET';
$CFG->dbpersist = false;
$CFG->prefix = 'mdl_';
$CFG->wwwroot = 'http://MY.SITE';
$CFG->dirroot = '/PATH/TO/MOODLE';
$CFG->dataroot = '/PATH/TO/MOODLEDATA';
$CFG->admin = 'admin';
$CFG->directorypermissions = 00777;
To duplicate this Moodle instance by command. The new one comes up as http://MY.SITE/copy/ If that is already there, it will be overwritten.
What is needed
a) The following commands put together as a shell script:
rm -rf /PATH/TO/MOODLECOPY
cp -ra /PATH/TO/MOODLE /PATH/TO/MOODLECOPY
rm -rf /PATH/TO/MOODLEDATACOPY
cp -ra /PATH/TO/MOODLEDATA /PATH/TO/MOODLEDATACOPY
cp -a /PATH/TO/config.php /PATH/TO/MOODLECOPY
/PATH/TO/mysqldump --databases MDLDB --user=MDLUSER --password=SECRET > mysqldump.sql
/PATH/TO/patch mysqldump.sql mysqldump.diff
/PATH/TO/mysql -u MDLUSER -pSECRET < mysqldump.sql
b) The config.php for the copy. These lines differ from the orignal:
$CFG->dbname = 'MDLDBCOPY';
$CFG->wwwroot = 'http://MY.SITE/copy';
$CFG->dirroot = '/PATH/TO/MOODLECOPY';
$CFG->dataroot = '/PATH/TO/MOODLEDATACOPY';
c) The mysql.diff I've generated by manually editing a copy of the mysqldump.sql I got above and running "diff mysqldump.sql mysqldumpnew.sql > mysqldump.diff". It looks like:
< -- Current Database: `MDLDB`
> -- Current Database: `MDLDBCOPY`
< CREATE DATABASE /*!32312 IF NOT EXISTS*/ `MDLDB` /*!40100 DEFAULT CHARACTER SET utf8 */;
> DROP DATABASE /*!32312 IF EXISTS*/ `MDLDBCOPY`;
> CREATE DATABASE `MDLDBCOPY` /*!40100 DEFAULT CHARACTER SET utf8 */;
< USE `MDLDB`;
> USE `MDLDBCOPY`;
Alias /copy/ "/PATH/TP/MOODLECOPY/"
Just run the shell script in a) keeping b) and c) in the current directory.