Submitted by kenlyle on Sun, 03/14/2010 - 11:23
I have about 20 SugarCRM instances. It appears that my clients are not taking to Sugar as I thought they would.
I would like to batch delete these instances.
Failing that, I would like to have a clean way to locate/list the paths to these instances.
Thanks, K
Status:
Closed (fixed)
Comments
Submitted by JamieCameron on Sun, 03/14/2010 - 13:10 Comment #1
This is one of those things that is best done using the command-line API. If you wanted to remove all instances of sugarcrm from all domains, you could do it with a shell loop like :
for dom in \`virtualmin list-domains --name-only\`; do
virtualmin delete-script --domain $dom --type sugarcrm
done
Submitted by kenlyle on Sun, 03/14/2010 - 13:34 Comment #2
Can we enhance this a tiny bit to say, if a certain table in the installed application's database has < X records?
For example, delete SugarCRM if the number of Contacts is <2.
It's awesomely cool that there's an API. I'd still love to be able to execute this inquiry from the Virtualmin GUI.
Best, K
Submitted by JamieCameron on Sun, 03/14/2010 - 13:37 Comment #3
I guess you could do that by putting a call to mysql in the script, but you'd have to do your own shell scripting ..
This kind of specific request is much more suited to the API than the Virtualmin GUI.
Submitted by kenlyle on Sun, 03/14/2010 - 13:39 Comment #4
Is there an API way to get the name of the database associated with a script installer? Then that name could be passed to the MySQL call...
Thanks, K
Submitted by JamieCameron on Sun, 03/14/2010 - 15:31 Comment #5
Yes .. you could get the DB name with a command like :
virtualmin list-scripts --domain $dom --type sugarcrm --multiline | grep Database: | awk '{ print $2 }'
Submitted by Issues on Sun, 03/28/2010 - 16:19 Comment #6
Automatically closed -- issue fixed for 2 weeks with no activity.