PDA

View Full Version : HOWTO: create soholaunch demo 4.6


Ruben
09-02-2004, 09:59 AM
Hi,

I just found a howto i posted in the old forum and am placing it back here now.
This howto lets your potential new customers test a soholaunch version and it features and will install everyday a fresh install, so your demo does not get corrupted by users changing settings, passwords, place weird text, because above all, you want your demo to look nice as well, right?

I will see if i have time to place everything in a file and make it more detailed if nobody understands this. (but then i recommend you not use this in the first place :-) )

here is the howto:
---------------------

asuming you have your demo installed on a dir on an existing domain like http://www.yourdomain.com/sohodemo/

as root
put in the folder /home/virtual/testdomain.com/var/www/ your tar'ed demo (soho-demo.tar.gz)

create in this same folder a file called sohodemodrop.sql ( which will delete all soho tables, see below) and chmod it to 777:
put this contect (without the ----) in this file.
----------------------------------------
DROP TABLE `BLOG_CATEGORY`, `BLOG_CONTENT`, `CAMPAIGN_MANAGER`, `STATS_BROWSER`, `STATS_BYDAY`, `STATS_BYHOUR`, `STATS_REFER`, `STATS_TOP25`, `STATS_UNIQUE`, `UDT_BLOG`, `UDT_CONTENT_SEARCH_REPLACE`, `UDT_KONTAKTFORM_EMAIL`, `UNSUBSCRIBE`, `calendar_category`, `calendar_display`, `calendar_events`, `cart_category`, `cart_customers`, `cart_invoice`, `cart_options`, `cart_paypal`, `cart_products`, `cart_shipping_opts`, `cart_tax`, `login`, `photo_album`, `sec_codes`, `sec_users`, `site_pages`;

-------------------
save the following file (i call it 'setsohodemo' in /etc/cron.daily (or weekly or monthly)
and chmod it to 755

change the following:
change testdomain.com --> the domain you have the demo installed on
change testdomain_com --> the database you have the mysql files installed on

--------------------

#!/bin/sh
cd /home/virtual/testdomain.com/var/www/html/
rm -rf sohodemo/
cd /home/virtual/testdomain.com/var/www/
cp soho-demo.tar.gz html/sohodemo/
cd html/sohodemo
tar -xvzf soho-demo.tar.gz
rm -rf soho-demo.tar.gz
cd /home/virtual/testdomain.com/var/www/
mysql -uroot -pyourdatabasepassword testdomain_com < /home/virtual/testdomain.com/var/www/sohodemodrop.sql
mysql --force -uroot -pourdatabasepassword testdomain_com < /home/virtual/testdomain.com/var/www/sohodemoSQL.sql

Cameron Allen
09-02-2004, 02:48 PM
Good stuff ruben.

R-n-R
09-07-2004, 10:54 AM
Yeah it is good, maybe you should pin this topic

JMorris
03-23-2006, 10:29 AM
LOL! I wish I would have found this topic sooner.

The above is great... IF you have root access. However, if you don't have root access, but you do have cron support (for instance, if you are on a shared hosting account [Like hosting resellers]), you can use the following to setup a demo site.

1. Perform an install of the basic software.
2. Configure the demo the way you want it to look and function to your users [including your branding, explanations, etc]
3. Create a directory where you would like to store your database dump file. (Use a name that only you will know. Better yet, move the file outside the web root for better security.)
4. Perform a database dump either using a tool like phpMyAdmin, or via the command line [if you have SSH access].

Performing a database dump via SSH:

mkdir /home/user/dbbackups <--- Folder where you want to dump the database to
cd /home/user/dbbackups
mysqldump --host=dbserver --user=dbuser --password=dbpass --database dbname > soholaunch_demo.sql


5. Next, create a shell script that you can point cron to. This will fully automate restoring your demo site's database. Let's call it soholaunch_demo.sh, or whatever you want.


#!/bin/sh
cd /home/user/dbbackups
mysql --host=dbserver --user=dbuser --password=dbpass --database dbname < soholaunch_demo.sql


6. Finally, configure a cronjob that will run hourly to restore the database of your demo site. You can do this through your hosting control panel, or via SSH using the following command.


crontab -e
#####[Begin Crontab Editor]#####

0 * * * * /home/user/dbbackups/soholaunch_demo.sh > /dev/null

#####[type :wq to save the job]#####
#####[End Crontab Editor]#####


That should do it. You should now have a functioning demo of Soholaunch that automatically refreshes every hour, on a shared hosting account. Enjoy!