I use the following code to make a hot backup of our production tree to the development tree. The script takes care of the configuration file, default web address and changes the company logo.
It can be easily modified to clone to another system.
I hope this help.
Code:
#!/bin/sh
# Description: make hot backup of the production tree to development tree
# Author: Richard Bemrose, http://www.cambridgeonline.net
# Assumptions:
# Production SugarCRM in "prod" directory
# Production database "sugarcrmprod"
# Production URL http://10.99.101.14
# Development SugarCRM in "dev" directory
# Development database "sugarcrmdev"
# Development URL http://10.99.101.14/dev
echo removing development tree
\rm -rf dev
echo copying production to development sugarcrm
cp -rp prod dev
cd dev
echo making changes to config.php
perl -p -i.bak -e 's/sugarcrmprod/sugarcrmdev/g' config.php
perl -p -i.bak -e 's/http:\/\/10.99.101.14/http:\/\/10.99.101.14\/dev\//g' config.php
# make the uses aware they are using the development tree
cd themes
for dir in *; do
\cp /opt/sugarcrm/images/developement-sugarcrm-large.png $dir/images/company_logo.png
done
mysqladmin -f drop sugarcrmdev
echo making hot backup of prod to dev
mysqlhotcopy -q sugarcrmprod sugarcrmdev Regards,
Rich
Bookmarks