Select Page

Renew a Joomla Demo Site

Renew a Joomla Demo Site

joomla_cms

The demo site demo.waltercedric.com is automatically deleted (database and file system) and restored every 60 minutes to wipe the system clean for other new users.

login to Administrator panel is

loginadmin
passwordadmin


How I’ve done it…
 green value have to been replace

1. Create all needed directories

Ex for plesk
# mkdir /var/www/vhosts/waltercedric.com/private/db-demo-initial
# mkdir /var/www/vhosts/waltercedric.com/private/file-demo-initial

2. First make a INITIAL backup from the database

In the state you want it to be for your demosite with mysqldump:
# mysqldump -u [DatabaseUsername] -p [DatabasePassword] [DatabaseName] > /path/to/filename

Ex for plesk
Files are store in private directory so only me can access them.
# mysqldump -uDatabaseUser -pDatabasePassword DatabaseName > /var/www/vhosts/waltercedric.com/private/db-demo-initial/DatabaseName.sql

3. Then make an INITIAL backup of the file structure

#  cp -pir srcDirectoy destinationDirectory

Ex for plesk
# cp -prf /var/www/vhosts/waltercedric.com/subdomains/demo/httpdocs/* /var/www/vhosts/waltercedric.com/private/file-demo-initial


4. Then put everything in a CRONTAB

The purpose of this task is to restore file periodically, You can use mysqqlimport (but it didnt worked for Me), so I use the mysql command line
If you want lets say: restore database every 1 hours, ten past the hour, your crontab entry would look like this:

10 */1 * * * mysql -u[username] -p[password] [databasename] < [/path/to/filename]

If you want lets say: restore file every 1 hours, twenty past the hour, your crontab entry would look like this:
20 */1 * * *  cp -pir srcDirectoy destinationDirectory

Ex
5 */1 * * * cp -prf /var/www/vhosts/waltercedric.com/private/file-demo-initial/*  /var/www/vhosts/waltercedric.com/subdomains/demo/httpdocs
6 */1 * * * mysql -uXXXX -pYYYYY demo < /var/www/vhosts/waltercedric.com/private/db-demo-initial/demo.sql

About The Author

I worked with various Insurances companies across Switzerland on online applications handling billion premium volumes. I love to continuously spark my creativity in many different and challenging open-source projects fueled by my great passion for innovation and blockchain technology.In my technical role as a senior software engineer and Blockchain consultant, I help to define and implement innovative solutions in the scope of both blockchain and traditional products, solutions, and services. I can support the full spectrum of software development activities, starting from analyzing ideas and business cases and up to the production deployment of the solutions.I'm the Founder and CEO of Disruptr GmbH.

Categories