Upgrade from 5.9.4 -> 6.0.3 without CLI

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Schickler
    Junior Member
    • Nov 2020
    • 3

    Upgrade from 5.9.4 -> 6.0.3 without CLI

    Hi!

    I´m running version 5.9.4 on a hosting package which offers no CLI access. Although not recommended, installing the upgrade packages via Webinterface worked flawlessly so far.

    But in updating to 6.0.3 I hit a barrier: the web updater says: "This upgrade can be run only from CLI.".

    What are my options?
  • Maximus
    Senior Member
    • Nov 2018
    • 2731

    #2
    Hi there,
    please check out for this post https://forum.espocrm.com/forum/anno...3859#post63859.

    If you will chose the second option then you will need do something like this:
    In the file /EspoCRM-upgrade-5.9.4-to-6.0.3/scripts/BeforeUpgrade.php find this piece of code:
    PHP Code:
    protected function processCheckCLI()
    {
        $isCli = (substr(php_sapi_name(), 0, 3) == 'cli') ? true : false;
    
        if (!$isCli) {
            throw new Error("This upgrade can be run only from CLI.");
        }
    } 
    
    Rewrite this function as follows:
    PHP Code:
    protected function processCheckCLI()
    {
    } 
    
    After, zip files again to make the upgrade package and upgrade your system.

    Also, to make sure that your system data in safe, you can ask your server support team to make a backup of your instance and its DB before the upgrade

    Comment

    • Schickler
      Junior Member
      • Nov 2020
      • 3

      #3
      I backed up and followed your suggestions. Unfortunately the upgrade failed with an error "null". Nothing in the php error log. Login mask appears on http, on https just a white screen. After that login fails with a 500 server error on 2FA. Had to roll back all changes. :-(

      So my only option seems to be to move everything to a root server, perform updates there and then move everything back to the hosting package. Right?

      Comment

      • Maximus
        Senior Member
        • Nov 2018
        • 2731

        #4
        You also can try this:
        1. Open the same /EspoCRM-upgrade-5.9.4-to-6.0.3/scripts/BeforeUpgrade.php file;
        2. Remove the line: $this->processCheckCLI(); from the public function run($container)
        3. Remove the whole function - protected function processCheckCLI()
        4. Zip files again and upgrade EspoCRM.

        Comment

        • shalmaxb
          Senior Member
          • Mar 2015
          • 1602

          #5
          Hi, are you able to run cron jobs in your hosting? I did it that way. If you need, I can send the respective code, I used

          Comment

          • esforim
            Active Community Member
            • Jan 2020
            • 2204

            #6
            Who host are you with? I think all Host will have CLI offer. Even shared hosting.

            Comment

          • berkantr
            Junior Member
            • Aug 2020
            • 12

            #7
            Originally posted by Maximus
            You also can try this:
            1. Open the same /EspoCRM-upgrade-5.9.4-to-6.0.3/scripts/BeforeUpgrade.php file;
            2. Remove the line: $this->processCheckCLI(); from the public function run($container)
            3. Remove the whole function - protected function processCheckCLI()
            4. Zip files again and upgrade EspoCRM.
            Hi Maximus ,

            I am also getting the same error. I have followed the suggested solutions but the same error continues to appear.

            Comment

            • murray99
              Member
              • Jan 2017
              • 57

              #8
              Download the code base and the underlying MySql DB. Install locally and do the upgrade. Then re-upload your code base and MySql data?

              Comment

              • berkantr
                Junior Member
                • Aug 2020
                • 12

                #9
                I will set up a virtual server and try.

                Comment

                Working...