PyBlosxom |
/SW/business/SugarCRM:
SugarCRM's "Silent Upgrade"
Lately SugarCRM's up-until-recently rock-solid upgrade process has become flaky, and I have had to turn to the "silent upgrade" tool to get the job done. I have not yet stumbled across official documentation, but this[1] does the trick for me.
The first step is to get the upgrade zip, for example SugarCE-Upgrade-6.5.x-to-6.5.12.zip, onto the server. Then just run something like this:
php -f /home/sugartest/public_html/modules/UpgradeWizard/silentUpgrade.php /home/clayton/SugarCE-Upgrade-6.5.x-to-6.5.12.zip /tmp/sugarUpgrade.log /home/sugartest/public_html/ admin
where most of the parameters should be fairly self-evident: the last is the account name you login to SugarCRM with, the second last is the path to the SugarCRM installation you are upgrading.
Then you probably have to correct the permissions, as you probably ran the above as root:
chown -R www-data:sugarcrm public_html/
And finally login to SugarCRM and click through the menus to do the following:
Admin --> Repair --> Rebuild Relationships
[1] http://www.hostknox.com/tutorials/sugarcrm/silent-upgrade
posted at: 04:01 | path: /SW/business/SugarCRM | permanent link to this entry
/SW/business/SugarCRM:
SugarCRM Built-in Data Tranfer Tool is Highly Developed
SugarCRM is fundamentally a big, complicated address book, and any migration to SugarCRM can often reasonably include a wish to import a bunch of contact data from another application. In my case, I have a MySQL database.
To get this database into SugarCRM is basically a two-step process:
posted at: 01:31 | path: /SW/business/SugarCRM | permanent link to this entry
/SW/business/SugarCRM:
SugarCRM Upgrades
With "normal" PHP web applications, upgrading is a matter of downloading a tarball containing the new version of the application, unpacking it in the web root, and then running an upgrade.php script inside the new version to update the table structure of the back-end database to the new layout.
Not so with SugarCRM, and it is slightly non-obvious what the upgrade procedure might be. The first thing you notice when you download a tarball is that there is no upgrade (or update) script. Some poking around in the admin portion of the user interface leads to the discovery of an "Upgrade Wizard", so one's first instinct is to feed the afore-mentioned tarball (actually, in this case, a zip archive) into the Wizard. This does not work, and in fact complains about a "missing manifest.php script" in the archive.
In fact, what this wizard is looking for is a specific kind of file: an "upgrade" or a "patch" zip from sugarforge. And this somewhat buried page is where you need to go looking for these things:
http://www.sugarforge.org/frs/?group_id=6
posted at: 22:18 | path: /SW/business/SugarCRM | permanent link to this entry
/SW/business/SugarCRM:
A Simple SugarCRM API Class
This should give anyone needing to use the SugarCRM API a quickstart:
* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. */ ?> 'https://url.of.your.sugarcrm.installation.com/sugarcrm/soap.php', "uri" => 'http://www.sugarcrm.com/sugarcrm', "trace" => 1 ); //user authentication array (version is SOAP version) private $user_auth = array(); function __construct() { // must use constructor b/c of MD5 function call $this->user_auth = array( "user_name" => 'sugaruserid', "password" => MD5('yourpasswd'), "version" => '.01' ); } // arrays for input into sugarCRM modules var $contact = array(); var $account = array(); function login() { $this->client = new SoapClient(NULL, $this->options); $response = $this->client->login($this->user_auth); // var_dump($response); // just in case you need it $this->session_id = $response->id; printf("session id = ". $this->session_id); $this->user_id = $this->client->get_user_id($this->session_id); printf(" " . $this->user_auth['user_name'] . ' has a GUID of ' . $this->user_id . "
"); } function getModules() { $response = $this->client->get_available_modules($this->session_id); foreach ($response->modules as $i => $value) { printf($response->modules[$i] . "
"); } } function getModuleFields($module) { $response = $this->client->get_module_fields($this->session_id, $module); printf("Module " . $response->module_name .' has the following fields:' . "
"); printf("
'); } function setContactField($fieldname, $fieldvalue) { $this->contact[] = array("name" => $fieldname,"value" => $fieldvalue); } function storeContact() { // into sugar's Contacts database $response = $this->client->set_entry($this->session_id, 'Contacts', $this->contact); var_dump($response); } } ?>
" . " "); foreach ($response->module_fields as $i => $value) { printf('Name Type Label " . "Required Options " . "'); } printf(' ' . $response->module_fields[$i]->name . ' ' . '' . $response->module_fields[$i]->type . ' ' . '' . $response->module_fields[$i]->label . ' ' . '' . $response->module_fields[$i]->required . ' ' . '' . $response->module_fields[$i]->options . '
And the following is a simple example of how to use the above class to create a simple contact record with a name and an e-mail address, and store it in Sugar's Contacts database.
login(); // populate the contact array $sugar->setContactField('last_name', 'Bloke2'); $sugar->setContactField('email1', 'xyz@wxy.net'); // var_dump($sugar->contact); $sugar->storeContact(); // to Contacts database ?>
To find out all the possible fields in the Contacts database, use this script:
login(); // look what modules sugar exposes $sugar->getModules(); // look in more detail at the fields in a module $sugar->getModuleFields('Accounts'); ?>
Many thanks to this post[1] for getting me on my way.
[1] http://systemsconsciousness.com/2009/04/10/sugarcrm-soap-examples/
posted at: 04:14 | path: /SW/business/SugarCRM | permanent link to this entry
/SW/business/SugarCRM:
Introduction to SugarCRM API
Documentation sucks. Their wiki[1] is flat-out wrong. Thankfully the blog world has some good information[2], though beware older posts are often obsolete and also will not work. This example should hopefully quickstart you and get you past the first crucial step of login through the API:
'https://url.of.your.sugarcrm.installation/soap.php', "uri" => 'http://www.sugarcrm.com/sugarcrm', "trace" => 1 ); // connect to soap server $client = new SoapClient(NULL, $options); //user authentication array (version is SOAP version) $user_auth = array( "user_name" => 'username', "password" => MD5('password'), "version" => '.01' ); $response = $client->login($user_auth); // var_dump($response); // just in case you need it $session_id = $response->id; printf("session id = ". $session_id); $user_guid = $client->get_user_id($session_id); printf(" " . $user_auth['user_name'].' has a GUID of ' . $user_guid . "
"); // look what modules sugar exposes $response = $client->get_available_modules($session_id); foreach ($response->modules as $i => $value) { printf($response->modules[$i] . "
"); } ?>
I think this code is quite self-explanatory. If it does not work, uncomment the var_dump of the login response, which will tell you the error string you are getting back.
[1] http://www.sugarcrm.com/wiki/index.php?title=SOAP_Intro_and_Practical_Examples
[2] http://systemsconsciousness.com/2009/04/10/sugarcrm-soap-examples/
posted at: 04:54 | path: /SW/business/SugarCRM | permanent link to this entry
/SW/business/SugarCRM:
SugarCRM Language Pack Installation
https://www.sugarcrm.com/forums/showthread.php?t=34942 is a very useful post.
Thereafter the language is an option at login. I have found no way to hard code a default language for a particular user (though there is a system-wide default). I have also discovered that a userid in the current SugarCRM, once created, can never be deleted.
posted at: 01:22 | path: /SW/business/SugarCRM | permanent link to this entry
/SW/business/SugarCRM:
SugarCRM Installation
Download latest Open Source version from: http://www.sugarforge.org/, then install it:
unzip SugarCE-5.2.0c.zip
chown -R www-data:www-data SugarCE-Full-5.2.0c/
ln -s SugarCE-Full-5.2.0c/ sugarcrm
(Installation docs can be found at https://www.sugarcrm.com/crm/support/documentation.)
Now invoke the installation wizard by pointing your browser at install.php, for instance:
http://apps.vancouversolidcomputing.com/sugarcrm/install.php
and step through to the "Custom Install" point where the database is setup.
Database Name: apps_sugarcrm
Host Name: localhost
Database Administrator Username: root
Database Admin Password: mysql root password
Sugar Database Username: apps_sugarcrm
Sugar Database User Password: vsc apps mysql password
Next screen is "Site Configuration": select a meaningful unique System Name, and record the admin password.
posted at: 23:34 | path: /SW/business/SugarCRM | permanent link to this entry