{"id":11339,"date":"2008-08-19T03:50:39","date_gmt":"2008-08-19T00:50:39","guid":{"rendered":"https:\/\/mamchenkov.net\/wordpress\/?p=11339"},"modified":"2008-08-19T03:50:39","modified_gmt":"2008-08-19T00:50:39","slug":"sugarcrm-deployment-efforts","status":"publish","type":"post","link":"https:\/\/mamchenkov.net\/wordpress\/2008\/08\/19\/sugarcrm-deployment-efforts\/","title":{"rendered":"SugarCRM deployment efforts"},"content":{"rendered":"<!-- google_ad_section_start -->\n<p>Since we started <a href=\"https:\/\/mamchenkov.net\/wordpress\/2008\/07\/15\/migrating-ms-dynamics-crm-to-sugarcrm\/\">working on SugarCRM<\/a> in the office, one of the hardest tasks that we had was solving the deployment issue.\u00a0 On one hand, SugarCRM comes with some really nice GUI tools, such <strong>Studio<\/strong> and <strong>Module Builder<\/strong>.\u00a0 On the other hand, the system is large and complex and should be developed and tested in a separate, non-production environment.<\/p>\n<p>We&#8217;ve spent a lot of effort over the last couple of month trying to solve the puzzle.\u00a0 The problem is that there is a tricky combination of files updates and database changes, some of which can be just copied over while others have to be executed from the destination machine&#8217;s administration.<\/p>\n<p>So, what we did first was complete separation of environments.\u00a0 Each developer had his own machine on which he could install and configure as many instances of SugarCRM as he saw fit.\u00a0 Also, each developer had a separate branch in the Subversion, so that he could work on his own stuff without being afraid to run into conflict with anyone.<\/p>\n<p>After that, we created a development server with a checkout of common trunk.\u00a0 For extra insurance, we did a checkout from a system user, who does not have any write permissions in the repository.\u00a0 In this case, even if someone will accidentally try to commit from the development server, we would be sure that it fails.<\/p>\n<p>Now, each developer had to merge his changes into trunk, and then test them on the development server.\u00a0 This procedure is very similar to the production deployment and consisted of two parts.\u00a0 Firts part was updating all the relevant files (a bit more on this in a moment) with <em>svn update<\/em>.\u00a0 Second part was logging into SugarCRM and doing <em>Admin -&gt; Repair -&gt; Quick Repair and Rebuild<\/em>.<\/p>\n<p>The graphical tools that come with SugarCRM are powerful, but a bit confusing.\u00a0 The biggest confusion for me was (and maybe still is) between Module Builder and Studio.\u00a0 Studio can be used to customize core modules that are shipped with SugarCRM.\u00a0 The results of these customizations are stored in <em>custom\/modules<\/em> directory, and when loaded into the database, can be observed in _cstm tables (for example, <em>accounts_cstm<\/em>).\u00a0 This is where new custom fields and things like that are going.\u00a0 Module Builder is a tool which can help you customize existing modules or build the new ones. The confusion here is because both of these tools can be used to do the same things.\u00a0 But with Module Builder you&#8217;d be working closer to the core system and modifying &#8220;original&#8221; functionality.\u00a0 You can build your own modules too, by the way.\u00a0 The results of the Module Builder work with go into <em>modules\/<\/em> directory, and changes in the database will take place in the original tables.\u00a0 One thing to remember though, is that you&#8217;ll need to push <em>Save &amp; Deploy<\/em> button every time you are finished with changes in Module Builder.\u00a0 This is like compiling and building a module.\u00a0 If you forget this step, then your module will hang in its source somewhere around <em>custom\/modulebuilder<\/em> directory.<\/p>\n<p>Another thing to keep in mind is the sillyness of the machine trying to figure out another machine.\u00a0 Meaning that Subversion will often have issues trying to figure out the changes from the last commit, and these issues would be often caused by a lot of automatically generated code by SugarCRM.\u00a0 In most of these problematic cases, Subversion will just merge the changes, and this would often result in a broken system.\u00a0 I&#8217;ve found at least two reasons behind these: small context size that Subversion uses (3 lines or so) confuses it sometimes, bringing it to a wrong place in the file to do the merging; and rather messy automatically generated stuff by SugarCRM &#8211; unnecessary reordering and mixed (DOS and UNIX) ends of lines in a single file.\u00a0 These problems are mostly related to vardef files (vardef.php and anything *def.php) and language dictionaries (anything with *en_us*php, or whatever your locale is).\u00a0 The solution we are using at the moment is simple, although a bit heavy on the manual work &#8211; instead of merging the changes and checking them every time we simply remove old versions of files and add the new ones in two separate commits.\u00a0 These way Subversion treats the files as completely different ones and real removes and re-creates them instead of trying to merge.<\/p>\n<p>We follow exactly the same procedure now to deploy to the production server.\u00a0 We just merge code from <em>trunk\/<\/em> to <em>branches\/stable<\/em> , commit, then update the files on the production server, and then do the <em>Quick Repair and Rebuild<\/em>.<\/p>\n<p>The thing about Quick Repair and Rebuild is that it takes the update definitions of your forms and layouts and rebuilds compiled templates.\u00a0 It also compares the structure of the database with the update definitions in the files and, if needed, updates the database scheme too.\u00a0 Sometimes you&#8217;d get an error of missing table (usually custom tables with _cstm suffix) &#8211; just create an empty table manually.\u00a0 Put a couple of standard fields like id_c, date_modified, and date_entered.\u00a0 After that, field modifications should be OK.\u00a0 In case you run into a problem with updates to several fields at once, make sure that SugarCRM put a semicolon (;) at the end of each SQL statement that it shows you in a popup window.\u00a0 For some weird reason, sometimes it just works, and sometimes it tries to execute several queries without separating them one from another.<\/p>\n<p>So far the setup seems to be working for us just fine, but I&#8217;m sure that we&#8217;ll have a few changes here and there.\u00a0 I&#8217;ll let you know once we find any better way of doing things.\u00a0 In the meantime, here are some links that might help your development efforts:<\/p>\n<ul>\n<li><a href=\"http:\/\/www.sugarcrm.com\/wiki\/index.php?title=Model-View-Controller_(MVC)\">SugarCRM Model-View-Controller (MVC)<\/a><\/li>\n<li><a href=\"http:\/\/www.sugarcrm.com\/wiki\/index.php?title=SugarBean\">SugarCRM SugarBean<\/a><\/li>\n<li><a href=\"http:\/\/www.sugarcrm.com\/wiki\/index.php?title=Vardefs\">SugarCRM Vardefs<\/a><\/li>\n<li><a href=\"http:\/\/www.sugarcrm.com\/wiki\/index.php?title=Performance_Tweaks_for_Large_Systems\">SugarCRM Performance Tweaks for Large Systems<\/a><\/li>\n<\/ul>\n<!-- google_ad_section_end -->\n","protected":false},"excerpt":{"rendered":"<!-- google_ad_section_start -->\n<p>Since we started working on SugarCRM in the office, one of the hardest tasks that we had was solving the deployment issue.\u00a0 On one hand, SugarCRM comes with some really nice GUI tools, such Studio and Module Builder.\u00a0 On the other hand, the system is large and complex and should be developed and tested in &hellip; <a href=\"https:\/\/mamchenkov.net\/wordpress\/2008\/08\/19\/sugarcrm-deployment-efforts\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">SugarCRM deployment efforts<\/span><\/a><\/p>\n<!-- google_ad_section_end -->\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_links_to":"","_links_to_target":""},"categories":[1,18,133],"tags":[1586,1587,39,1538,19,1588],"keyring_services":[],"class_list":["post-11339","post","type-post","status-publish","format-standard","hentry","category-general","category-programming","category-sysadmin","tag-deployment","tag-patching","tag-software","tag-sugarcrm","tag-tools","tag-version-control"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":26232,"url":"https:\/\/mamchenkov.net\/wordpress\/2016\/07\/13\/sugarcrm-cache-directory-it-is-not-a-cache-directory\/","url_meta":{"origin":11339,"position":0},"title":"SugarCRM cache directory \u2013 it is NOT a cache directory!","author":"Leonid Mamchenkov","date":"July 13, 2016","format":false,"excerpt":"Here is a useful reminder from a few years back - \"SugarCRM cache directory \u2013 it is NOT a cache directory!\". \u00a0 Unlike most modern day web applications, which use cache\/ folder for temporary files, which are safe to delete, SugarCRM keeps a bunch of stuff in there, which, if\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":25961,"url":"https:\/\/mamchenkov.net\/wordpress\/2016\/03\/20\/single-sign-on-sugarcrm-roundcube-multiple-php-sessions\/","url_meta":{"origin":11339,"position":1},"title":"Single Sign-On with SugarCRM and RoundCube Using Multiple PHP Sessions","author":"Leonid Mamchenkov","date":"March 20, 2016","format":false,"excerpt":"I am currently involved in an interesting integration project at work. \u00a0As part of it, we need to create a single sign-on process between\u00a0SugarCRM (version 6.5.20) and RoundCube (version 1.1.4) webmail application. \u00a0RoundCube webmail is being displayed within the iframe inside the SugarCRM user interface, so it would help if\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":11210,"url":"https:\/\/mamchenkov.net\/wordpress\/2008\/05\/29\/toolbox-wordpress-cakephp-sugarcrm-rt\/","url_meta":{"origin":11339,"position":2},"title":"Toolbox : WordPress, CakePHP, SugarCRM, RT","author":"Leonid Mamchenkov","date":"May 29, 2008","format":false,"excerpt":"Over the last couple of years I've been working a lot with these four applications - WordPress, CakePHP, SugarCRM, and RT.\u00a0 Each of these is beautiful in its own way.\u00a0 Each of these tools is an Open Source Software. Each of these tools has a large community. Each of these\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":11326,"url":"https:\/\/mamchenkov.net\/wordpress\/2008\/08\/03\/innodb-is-better-for-sugarcrm\/","url_meta":{"origin":11339,"position":3},"title":"InnoDB is better for SugarCRM","author":"Leonid Mamchenkov","date":"August 3, 2008","format":false,"excerpt":"After SugarCRM was deployed, we were experiencing some lock ups.\u00a0 Not frequent or dangerous, but annoying.\u00a0 About once a week or every ten days or so, SugarCRM would lock up and won't answer any queries at all.\u00a0 Not even the login was possible.\u00a0 A brief investigation showed that somehow it\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":26001,"url":"https:\/\/mamchenkov.net\/wordpress\/2016\/04\/06\/sugarcrm-roundcube-and-request-tracker-integration-on-a-single-domain\/","url_meta":{"origin":11339,"position":4},"title":"SugarCRM, RoundCube and Request Tracker integration on a single domain","author":"Leonid Mamchenkov","date":"April 6, 2016","format":false,"excerpt":"In my years of working as a system administrator I've done some pretty complex setups and integration solutions, but I don't think I've done anything as twisted as this one recently. \u00a0The setup is part of the large and complex client project, built on their infrastructure, with quite a few\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"SAML workflow","src":"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2016\/04\/saml_workflow_vertical-500x469.gif?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":11313,"url":"https:\/\/mamchenkov.net\/wordpress\/2008\/07\/15\/migrating-ms-dynamics-crm-to-sugarcrm\/","url_meta":{"origin":11339,"position":5},"title":"Migrating MS Dynamics CRM to SugarCRM","author":"Leonid Mamchenkov","date":"July 15, 2008","format":false,"excerpt":"I've been a bit quiet for the last couple of month.\u00a0 That's because I was leading an ambicious project at my new job - migration of a Microsoft Dynamics CRM version 3 to SugarCRM Community Edition version 5.0.0.\u00a0 There were only three people involved, non of us could afford to\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/11339","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/comments?post=11339"}],"version-history":[{"count":0,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/11339\/revisions"}],"wp:attachment":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/media?parent=11339"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/categories?post=11339"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/tags?post=11339"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/keyring_services?post=11339"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}