Page 1 of 7 12345 ... LastLast
Results 1 to 10 of 67

Thread: Command-line upgrade for large systems

  1. #1
    clint's Avatar
    clint is offline Sugar Team Member | Forums Lead Moderator
    Join Date
    Aug 2004
    Location
    Silicon Valley
    Posts
    2,120

    Default Command-line upgrade for large systems

    SugarCRM provides a command-line upgrade tool called silentupgrade.php that allows you to workaround upgrade issues resulting from large databases or large upgrade files.

    Overview
    The silentupgrade.php is a stand-alone PHP script that can be run from the command prompt for upgrading a Sugar instance, starting with the 4.5.1x to 5.0.0x upgrade path.

    SugarCRM comes with the built-in Upgrade Wizard as part of the application that you invoke through a browser. The Silent Upgrader is executed at the command line on the server where the Sugar instance is installed.

    Download
    For Community Edition users, you will find the Silent Upgrader here.

    For Professional and Enterprise Edition users, you will find the Silent Upgrader in the Download Manager here.

    Before running the command-line Silent Upgrader
    First read this important information in the Sugar 5.0 Upgrade Release Notes.

    Why is silentupgrade.php useful for major release upgrades?
    With major releases like Sugar 5.0.0, 5.5.0 and 6.0.0, the upgrade process requires system resources that are sometimes beyond the Web execution environment settings. Using the Silent Upgrader enables you to avoid some of the limitations that the Web application environment may have that prevents the Upgrade Wizard from completing the upgrade. The upload size limit (by PHP and sometimes even by Web server), the CGI (or equivalent) timeout limit, and the MySQL (or equivalent) session timeout limit are some of the challenges people run into when upgrading to Sugar 5.0.0x. The Silent Upgrader either avoids the limitations or better controls the settings in its stand-alone execution environment.

    Note: After upgrading with the Silent Upgrader, you will need to rebuild the relationship metadata. To do this, log in as the administrator. On the Administration Home page, select the Repair option in the Systems sub-panel and click Rebuild Relationships.


    How do you run silentupgrade.php?
    To execute the silentupgrade.php script, you need to supply the three parameters, as described in the Arguments section below.

    Usage: php.exe -f silentUpgrade.php [upgradeZipFile] [logFile] [pathToSugarInstance] [adminUser]

    Arguments:


    • upgradeZipFile - Full path to the upgrade zip file. Such as SugarCE-Upgrade-4.5.1-to-5.0.0.zip
    • logFile - Full path to an alternate log file.
    • pathToSugarInstance - Full path to the instance being upgraded.
    • adminUser - A valid admin user name

    Compatibility matrix for the Silent Upgrader:
    PHP versions : 4.4.4 onwards
    Databases : MySQL, MSSQL, Oracle
    Operating systems : Windows, Linux
    Upgrade from Sugar Instances : 4.5.1x

    Note: The silentUpgrade.php script creates new files for the user who is running it. For example, for the root user it create files as user/group root. Because Apache cannot read this, you must ensure that the Web server user has the permissions to read and write files/dir. For example check httpd.conf to find out the user/group.

    Note: If you see 'Notice: Undefined variable: argv' message on command prompt on executing silentUpgrade.php then go to php.ini and switch 'register_argc_argv' to On.

    Update:
    Post generalized for future releases after 5.0.0 where this tool was introduced.
    Last edited by clint; 2011-03-12 at 06:53 PM. Reason: Post generalized for future releases
    Sugar Developer Zone - developer resources | Sugar University - user and admin training
    Sugar Docs - user and admin documentation |
    Sugar Bug Tracker - Enter or view bugs
    SugarForge- open source modules, themes, lang packs | SugarExchange - commercial extensions

    Clint Oram
    Chief Technology Officer and Co-founder
    SugarCRM

  2. #2
    mcichelli is offline Sugar Community Member
    Join Date
    Jun 2006
    Posts
    81

    Default Re: New command-line upgrade tool for 5.0 solves many upgrade issues

    I'm having trouble with the parameter

    pathToSugarInstance - Full path to the instance being upgraded


    Which directory EXACTLY should this point to? I'm using a Windows installation. I have put all the other required files locally in the directory I'm running from, so I think my continued syntax errors on the command line must apply to the SugarInstance path.

    Martha

  3. #3
    clint's Avatar
    clint is offline Sugar Team Member | Forums Lead Moderator
    Join Date
    Aug 2004
    Location
    Silicon Valley
    Posts
    2,120

    Default Re: New command-line upgrade tool for 5.0 solves many upgrade issues

    Quote Originally Posted by mcichelli
    I'm having trouble with the parameter

    pathToSugarInstance - Full path to the instance being upgraded


    Which directory EXACTLY should this point to? I'm using a Windows installation. I have put all the other required files locally in the directory I'm running from, so I think my continued syntax errors on the command line must apply to the SugarInstance path.
    On a Windows machine, that would be something like:

    C:\Inetpub\wwwroot\sugarcrm

    or

    C:\htdocs\sugarcrm

    It needs to be the full directory path of where the SugarCRM installation resides on your file system.
    Sugar Developer Zone - developer resources | Sugar University - user and admin training
    Sugar Docs - user and admin documentation |
    Sugar Bug Tracker - Enter or view bugs
    SugarForge- open source modules, themes, lang packs | SugarExchange - commercial extensions

    Clint Oram
    Chief Technology Officer and Co-founder
    SugarCRM

  4. #4
    nlviands is offline Junior Member
    Join Date
    Feb 2008
    Posts
    3

    Default Re: New command-line upgrade tool for 5.0 solves many upgrade issues

    I am also having problems. I am trying to upgrade from 4.5.1i to 5.0.0b When I was trying it in sugar, like many I was getting that the max_upload_filesize error. So I thought I would try the comman line upgrade and I cant get this to work either.

    Here is what I am entering:

    root@ubuntu:/usr/share/sugarcrm# php -f silentUpgrade.php SugarCE-Upgrade-4.5.1-to-5.0.0b.zip silentupgrade.log /usr/share/sugarcrm root

    Nothing happens. Is /usr/share/sugarcrm my "path to sugar-instance"?

  5. #5
    mcichelli is offline Sugar Community Member
    Join Date
    Jun 2006
    Posts
    81

    Default Re: New command-line upgrade tool for 5.0 solves many upgrade issues

    I have silentUpgrade.php and SugarCE-Upgrade-4.5.1-to-5-0-0b.zip in

    C:\Program Files\sugarcrm-4-5-0\php


    I am executing the following command from C:\Program Files\sugarcrm-4.5.0\php

    php.exe -f silentUpgrade.php SugarCE-Upgrade-4.5.1-to-5.0.0b.zip silentupgrade.log C:\Program Files\sugarcrm-4.5.0\htdocs\sugarcrm martha


    I get the help screen explaining the syntax and the arguments - over and over no matter what I change seemingly.

    Martha

  6. #6
    vdhyani is offline Junior Member
    Join Date
    Dec 2006
    Posts
    143

    Default Re: New command-line upgrade tool for 5.0 solves many upgrade issues

    Where is your silentUpgrade.php located ? Keep the silentupgrade.php in C:\Program Files\sugarcrm-4-5-0\php as well.
    If you are launching from C:\Program Files\sugarcrm-4-5-0\php then php.exe should be there.

    Put your path in quotes " " . Following:

    >php.exe -f silentUpgrade.php "SugarCE-Upgrade-4.5.1-to-5.0.0b.zip" "C:\silentupgrade.log" "C:\Program Files\sugarcrm-4.5.0\htdocs\sugarcrm" martha

  7. #7
    djblade311 is offline Junior Member
    Join Date
    Apr 2008
    Posts
    3

    Default Re: New command-line upgrade tool for 5.0 solves many upgrade issues

    I uploaded the SugarCE-Upgrade-4.5.1-to-5.0.0b.zip to the root folder of sugarCRM, and ran the command:

    /usr/local/php5/bin/php silentUpgrade.php SugarCE-Upgrade-4.5.1-to-5.0.0b.zip /home/myusername/mysite.com/crm/upgradelogs/451_50.log /home/myusername/mysite.com/crm/ admin

    and also

    /usr/local/php5/bin/php silentUpgrade.php /home/myusername/mysite.com/crm/SugarCE-Upgrade-4.5.1-to-5.0.0b.zip /home/myusername/mysite.com/crm/upgradelogs/451_50.log /home/myusername/mysite.com/crm/ admin

    Received:


    ************************************************** ******************
    ***************This Upgrade process may take sometime***************
    ************************************************** ******************


    FAILURE


    and that is all. Any ideas?

  8. #8
    vdhyani is offline Junior Member
    Join Date
    Dec 2006
    Posts
    143

    Default Re: New command-line upgrade tool for 5.0 solves many upgrade issues

    Looking at the thread I think the problem is in Instance name /home/myusername/mysite.com/crm/
    This should be the path to the folder where instance files are located. home/myusername/Sugar451CE


    /usr/local/php5/bin/php silentUpgrade.php SugarCE-Upgrade-4.5.1-to-5.0.0b.zip
    /home/myusername/mysite.com/crm/upgradelogs/451_50.log
    /home/myusername/mysite.com/crm/ admin

  9. #9
    djblade311 is offline Junior Member
    Join Date
    Apr 2008
    Posts
    3

    Default Re: New command-line upgrade tool for 5.0 solves many upgrade issues

    Quote Originally Posted by vdhyani
    Looking at the thread I think the problem is in Instance name /home/myusername/mysite.com/crm/
    This should be the path to the folder where instance files are located. home/myusername/Sugar451CE


    /usr/local/php5/bin/php silentUpgrade.php SugarCE-Upgrade-4.5.1-to-5.0.0b.zip
    /home/myusername/mysite.com/crm/upgradelogs/451_50.log
    /home/myusername/mysite.com/crm/ admin
    Thanks but my SugarCRM is installed at /home/myusername/mysite.com/crm/ crm folder is the renamed folder that does contain the modules and files"


    Code:
    .                       log4php.properties        include
    ..                      log_file_restricted.html  install
    files.md5               maintenance.php           jscalendar
    .htaccess               metagen.php               log4php
    acceptDecline.php       PATCH.txt                 metadata
    campaign_tracker.php    pdf.php                   ModuleInstall
    campaign_trackerv2.php  phprint.php               modules
    config.php              README.txt                soap
    cron.php                removeme.php              themes
    dictionary.php          robots.txt                XTemplate
    download.php            soap.php                  sugarcrm.log
    emailmandelivery.php    sugar_version.php         config_override.php
    export.php              SugarSecurity.php         manifest.php
    HandleAjaxCall.php      TreeData.php              scripts
    image.php               UPGRADE.TXT               SugarCE-Upgrade-4.5.1-to-5.0.0
    index.php               vcal_server.php           upgradeWizard.log
    install.php             vCard.php                 backups
    INSTALLATION.txt        WebToLeadCapture.php      SugarCE-Upgrade-4.5.1-to-5.0.0b.zip
    json.php                cache                     silentUpgrade.php
    json_server.php         custom                    SILENTUPGRADE.txt
    leadCapture.php         data                      upgradelogs
    LICENSE.txt             examples                  home
    I should add that after the FAILURE result, the log file wasnt generated in the /home/myusername/mysite.com/crm/upgradelogs/ directory.

    I added more debugging to silentUpgrade.php and found that it was failing on:
    PHP Code:
    $unzip_dir clean_path("{$cwd}/{$sugar_config['upload_dir']}upgrades/temp/su_temp");
    $install_file clean_path("{$cwd}/{$sugar_config['upload_dir']}upgrades/patch/".basename($argv[1]));
    mkdir_recursive($unzip_dir);
    if(!
    is_dir($unzip_dir)) {
            die(
    "\nFAILURE: $unzip_dir\n");

    When does this directory get created? I tried to create it manually with no luck. I decided to do a fresh install of 5.0 but having fun trying to manually alter the 4.5.1 db and sitting the 5.0 install on top of the upgraded db
    Last edited by djblade311; 2008-04-09 at 05:21 PM.

  10. #10
    mcichelli is offline Sugar Community Member
    Join Date
    Jun 2006
    Posts
    81

    Default Re: New command-line upgrade tool for 5.0 solves many upgrade issues

    Quote Originally Posted by vdhyani
    Where is your silentUpgrade.php located ? Keep the silentupgrade.php in C:\Program Files\sugarcrm-4-5-0\php as well.
    If you are launching from C:\Program Files\sugarcrm-4-5-0\php then php.exe should be there.

    Put your path in quotes " " . Following:

    >php.exe -f silentUpgrade.php "SugarCE-Upgrade-4.5.1-to-5.0.0b.zip" "C:\silentupgrade.log" "C:\Program Files\sugarcrm-4.5.0\htdocs\sugarcrm" martha
    I just got back to this. I followed your syntax exactly and I still get the message that just tells me the syntax to use. Is there, by any chance, a way to enter each argument interactively instead of on the command line? Or could there be a version which would say WHICH PART of the command line it doesn't like?

    Martha

Page 1 of 7 12345 ... LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Upgrade wizard and command line issue
    By santasatan in forum Installation and Upgrade Help
    Replies: 1
    Last Post: 2010-08-14, 07:13 AM
  2. How to invoke core API from command line ?
    By ovh in forum Developer Help
    Replies: 1
    Last Post: 2009-12-03, 09:44 PM
  3. Command-Line Upgrade Tool - Patches?
    By jjwdesign in forum Installation and Upgrade Help
    Replies: 2
    Last Post: 2008-10-21, 02:52 PM
  4. Linux Command Line Help
    By drizendohs in forum Help
    Replies: 7
    Last Post: 2006-08-17, 06:21 PM
  5. Replies: 0
    Last Post: 2006-06-07, 01:42 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •