oroinc / crm

Main OroCRM package with core functionality.
Other
644 stars 212 forks source link

Currently on 1.10.13, can't upgrade to 2.0.0 #238

Closed leomasri closed 7 years ago

leomasri commented 7 years ago

Following the instructions: https://github.com/orocrm/crm/blob/master/UPGRADE-2.0.md , when running the replacement step 7: sudo -u www-data php app/console oro:platform:upgrade20 --env=prod --force

I get the following:

bitnami@ip-172-31-46-201:~/apps/orocrm/htdocs$ sudo -u bitnami php -d memory_limit=-1 app/console oro:platform:upgrade20 --env=prod --force

  [Symfony\Component\Console\Exception\CommandNotFoundException]  
  Command "oro:platform:upgrade20" is not defined.                
  Did you mean one of these?                                      
      oro:platform:update                                         
      oro:platform:run-script                                     
      oro:platform:optional-listeners                             

Should I update the console command? If so, how?.

Thanks in advance!

startupz commented 7 years ago

Did you update your vendors? It looks like you still have old vendors (in case of upgrade). Can you copy/paste your composer.json?

leomasri commented 7 years ago

Hi @startupz !

Thanks for your reply. Here's my composer.json:

{
    "name": "oro/crm-application",
    "description": "The OroCRM distribution",
    "homepage": "https://github.com/orocrm/crm-application.git",
    "license": "OSL-3.0",
    "autoload": {
        "psr-0": {
            "": "src/"
        }
    },
    "repositories": [
        {
            "type": "git",
            "url": "https://github.com/orocrm/TranslationFormBundle.git"
        },
        {
            "type": "composer",
            "url": "https://packagist.orocrm.com"
        }
    ],
    "require": {
        "oro/crm": "1.10.*",
        "oro/crm-zendesk": "^1.7",
        "oro/crm-mail-chimp": "^1.6",
        "atwix/oro-mandrill": "dev-master"
    },
    "require-dev": {
        "sensio/generator-bundle": "2.5.3",
        "squizlabs/php_codesniffer": "2.3.3",
        "behat/behat": "3.1.0",
        "behat/mink-extension": "^2.0",
        "behat/mink-selenium2-driver": "1.*",
        "bossa/phpspec2-expect": "~1.0",
        "behat/symfony2-extension": "2.1.1"
    },
    "config": {
        "component-dir": "web/bundles/components"
    },
    "scripts": {
        "post-install-cmd": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
            "Oro\\Bundle\\InstallerBundle\\Composer\\ScriptHandler::setPermissions",
            "Oro\\Bundle\\InstallerBundle\\Composer\\ScriptHandler::installAssets",
            "Oro\\Bundle\\InstallerBundle\\Composer\\ScriptHandler::setAssetsVersion"
        ],
        "post-update-cmd": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
            "Oro\\Bundle\\InstallerBundle\\Composer\\ScriptHandler::setPermissions",
            "Oro\\Bundle\\InstallerBundle\\Composer\\ScriptHandler::installAssets",
            "Oro\\Bundle\\InstallerBundle\\Composer\\ScriptHandler::setAssetsVersion"
        ]
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "extra": {
        "symfony-app-dir": "app",
        "symfony-web-dir": "web",
        "incenteev-parameters": {
            "file": "app/config/parameters.yml"
        }
    }
}
leomasri commented 7 years ago

@startupz should I run composer.phar update vendor/* --no-dev?

startupz commented 7 years ago

If you make a composer update you will only update to 1.10.x (last) version and not 2.0.x.

You should take composer.json and composer.lock from 2.0.0 tag here and make :

Don't forget to edit app/config/config.yml More info

leomasri commented 7 years ago

Package guzzle/guzzle is abandoned, you should avoid using it. Use guzzlehttp/guzzle instead. Writing lock file Generating autoload files

ComponentInstaller\Installer::postAutoloadDump Compiling component files Oro\Bundle\InstallerBundle\Composer\ScriptHandler::checkComposerPlugin Incenteev\ParameterHandler\ScriptHandler::buildParameters Updating the "app/config/parameters.yml" file Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile Oro\Bundle\InstallerBundle\Composer\ScriptHandler::setPermissions Oro\Bundle\InstallerBundle\Composer\ScriptHandler::installAssets Oro\Bundle\InstallerBundle\Composer\ScriptHandler::setAssetsVersion Updating the "assets_version" parameter

Now I'm getting an error running:

sudo -u bitnami php app/console oro:platform:upgrade20 --env=prod --force
PHP Fatal error:  Class 'JMS\JobQueueBundle\Console\Application' not found in /opt/bitnami/apps/orocrm/htdocs/app/console on line 30

Any ideas @startupz ?

startupz commented 7 years ago

You should remove /app/cache folder

leomasri commented 7 years ago

still the same:

bitnami@ip-172-31-46-201:~/apps/orocrm/htdocs$ sudo rm -rf app/cache/

bitnami@ip-172-31-46-201:~/apps/orocrm/htdocs$ ls app/
AppCache.php   attachment           check.php  console-framework       logs                 phpunit.xml.dist
AppKernel.php  autoload.php         config     dist                    oro-check.php        Resources
archive        bootstrap.php.cache  console    DistributionKernel.php  OroRequirements.php  SymfonyRequirements.php

bitnami@ip-172-31-46-201:~/apps/orocrm/htdocs$ sudo -u bitnami php -d memory_limit=-1 app/console oro:platform:upgrade20 --env=prod --force
PHP Fatal error:  Class 'JMS\JobQueueBundle\Console\Application' not found in /opt/bitnami/apps/orocrm/htdocs/app/console on line 30

:(

Any other ideas?

startupz commented 7 years ago

Yes of course!

Do you have some kind of APC cache enabled? If yes, you should restart php5-fpm or simply clear APC cache.

leomasri commented 7 years ago

Still the same:

bitnami@ip-172-31-46-201:~/apps/orocrm/htdocs$ sudo /opt/bitnami/ctlscript.sh restart php-fpm
Unmonitored php-fpm
/opt/bitnami/php/scripts/ctl.sh : php-fpm stopped
/opt/bitnami/php/scripts/ctl.sh : php-fpm started
Monitored php-fpm
bitnami@ip-172-31-46-201:~/apps/orocrm/htdocs$ sudo -u bitnami php -d memory_limit=-1 app/console oro:platform:upgrade20 --env=prod --force
PHP Fatal error:  Class 'JMS\JobQueueBundle\Console\Application' not found in /opt/bitnami/apps/orocrm/htdocs/app/console on line 30
sbani commented 7 years ago

I just saw this line:

  - Removing jms/job-queue-bundle (1.2.0)

But no info about an installation...

Looking at the composer.json in branch 2.0, I don't see the job queue bundle either.

Is it part of another bundle? Because it was required directly by oro/platform in v1.10

startupz commented 7 years ago

Maybe you should run php app/console cache:clear -vvv in order to have more informations.

mkudelya commented 7 years ago

Hi @leomasri

@sbani you are right!

I think your 'app/console' is old or custom and contains reference to JMS\JobQueueBundle, which was deleted in 2.0. Please change your version of orocrm to 2.0 via:

git checkout 2.0

leomasri commented 7 years ago

Thanks @sbani , @startupz , @mkudelya !

Got the command to run, but now it fails midway claiming it has no memory, although the server has 30gb and I'm setting the limit high... :(

bitnami@ip-172-31-46-201:/opt/bitnami/apps/orocrm/htdocs$ sudo php -d memory_limit=20G app/console oro:platform:upgrade20 --env=prod --force

 // Warming up the cache for the prod environment with debug false                                                      

 [OK] Cache for the "prod" environment (debug=false) was successfully warmed.                                           

We recommend at least 1Gb to be available for PHP CLI
Process migrations...
  > Oro\Bundle\EntityExtendBundle\Migration\LoadEntityConfigStateMigration
  > Oro\Bundle\CRMBundle\Migrations\Schema\OroCRMBundleInstaller
  > Oro\Bundle\MigrationBundle\Migration\UpdateBundleVersionMigration
  > Oro\Bundle\EntityExtendBundle\Migration\RefreshExtendCacheMigration
    PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 880968 bytes) in /opt/bitnami/apps/orocrm/htdocs/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FilesystemCache.php on line 106

    ERROR: The command terminated with an exit code: 255.
  > Oro\Bundle\EntityConfigBundle\Migration\UpdateEntityConfigMigration - skipped
  > Oro\Bundle\EntitySerializedFieldsBundle\Migration\SerializedDataMigration - skipped
  > Oro\Bundle\EntityExtendBundle\Migration\UpdateExtendConfigMigration - skipped
  > Oro\Bundle\ActivityContactBundle\Migration\ActivityContactMigration - skipped
  > Oro\Bundle\ActivityListBundle\Migration\ActivityListMigration - skipped
  > Oro\Bundle\EntityExtendBundle\Migration\UpdateExtendIndicesMigration - skipped
  > Oro\Bundle\EntityConfigBundle\Migration\WarmUpEntityConfigCacheMigration - skipped

  [RuntimeException]                                                                       
  Failed migrations: Oro\Bundle\EntityExtendBundle\Migration\RefreshExtendCacheMigration.  

oro:migration:load [--force] [--dry-run] [--show-queries] [--bundles [BUNDLES]] [--exclude [EXCLUDE]] [--timeout [TIMEOUT]] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-s|--shell] [--process-isolation] [-e|--env ENV] [--no-debug] [--disabled-listeners DISABLED-LISTENERS] [--] <command>

  [RuntimeException]                                                                                                                                     
  The command '/opt/bitnami/php/bin/php.bin' 'app/console' 'oro:migration:load' '--force' '--timeout=300' '--env=prod' terminated with an exit code: 1.  

oro:platform:update [--force] [--skip-assets] [--symlink] [--skip-translations] [--force-debug] [--timeout [TIMEOUT]] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-s|--shell] [--process-isolation] [-e|--env ENV] [--no-debug] [--disabled-listeners DISABLED-LISTENERS] [--] <command>

  [RuntimeException]                                                                                                                                      
  The command '/opt/bitnami/php/bin/php.bin' 'app/console' 'oro:platform:update' '--force' '--timeout=300' '--env=prod' terminated with an exit code: 1.  
mkudelya commented 7 years ago

I found "We recommend at least 1Gb to be available for PHP CLI" warning in your installation log. Here is source where it occurred. I think you should "googling" how to increase bitnami php limit.

sbani commented 7 years ago

Please try these commands to see if php -d works:

$ php -i | grep memory
$ php -d memory_limit=-1 -i | grep memory

My output:

$ php -i | grep memory
memory_limit => 128M => 128M
Collecting memory statistics => Yes

$ php -d memory_limit=-1 -i | grep memory
memory_limit => -1 => -1
Collecting memory statistics => Yes
leomasri commented 7 years ago

Perfect @sbani @mkudelya , managed to increase the memory_limit for the php client. Now I'm getting a doctrine error running the migrations:

bitnami@ip-172-31-46-201:~/apps/orocrm/htdocs$ sudo php -d memory_limit=20G app/console oro:platform:upgrade20 --env=prod --force

 // Warming up the cache for the prod environment with debug false                                                      

 [OK] Cache for the "prod" environment (debug=false) was successfully warmed.                                           

Process migrations...
  > Oro\Bundle\EntityExtendBundle\Migration\LoadEntityConfigStateMigration
  > Oro\Bundle\CRMBundle\Migrations\Schema\OroCRMBundleInstaller
  > Oro\Bundle\MigrationBundle\Migration\UpdateBundleVersionMigration
  > Oro\Bundle\EntityExtendBundle\Migration\RefreshExtendCacheMigration
  > Oro\Bundle\EntityConfigBundle\Migration\UpdateEntityConfigMigration
  > Oro\Bundle\EntitySerializedFieldsBundle\Migration\SerializedDataMigration
  > Oro\Bundle\EntityExtendBundle\Migration\UpdateExtendConfigMigration
  > Oro\Bundle\ActivityContactBundle\Migration\ActivityContactMigration
  > Oro\Bundle\ActivityListBundle\Migration\ActivityListMigration
  > Oro\Bundle\EntityExtendBundle\Migration\UpdateExtendIndicesMigration
  > Oro\Bundle\EntityConfigBundle\Migration\WarmUpEntityConfigCacheMigration
Loading permissions...
  > VIEW
  > CREATE
  > EDIT
  > DELETE
  > ASSIGN
  > CONFIGURE
  > MANAGE_API_KEY
  > TRANSLATE
Loading workflow definitions...
  > orocrm_contact_us_contact_request
  > task_flow
  > b2b_flow_lead
  > b2b_flow_sales_funnel
  > opportunity_flow
  > b2c_flow_abandoned_shopping_cart
  > b2c_flow_order_follow_up
Removing all previously loaded commands...
Processing command "oro:cron:email-body-sync": setting up schedule..
Processing command "oro:cron:definitions:load": Skipping, the command does not implement CronCommandInterface
Processing command "oro:cron:integration:cleanup": setting up schedule..
Processing command "oro:cron:integration:sync": setting up schedule..
Processing command "oro:cron:batch:cleanup": setting up schedule..
Processing command "oro:cron:imap-sync": setting up schedule..
Processing command "oro:cron:import-tracking": setting up schedule..
Processing command "oro:cron:tracking:parse": setting up schedule..
Processing command "oro:cron:send-email-campaigns": setting up schedule..
Processing command "oro:cron:calculate-tracking-event-summary": setting up schedule..
Processing command "oro:cron:lifetime-average:aggregate": setting up schedule..
Processing command "oro:cron:send-reminders": setting up schedule..
Processing command "oro:cron:analytic:calculate": setting up schedule..
Processing command "oro:cron:magento:cart:expiration": setting up schedule..
Processing command "oro:cron:mailchimp:export": setting up schedule..
Processing command "oro:cron:dotmailer:export-status:update": setting up schedule..
Processing command "oro:cron:dotmailer:mapped-fields-updates:process": setting up schedule..
[info] > process definition: "sync_email_flag_after_changed" - updated
[info] > process definition: "schedule_integration" - updated
[info] > process definition: "clear_user_email_origin_on_deactivation" - updated
[info] > process definition: "clear_imap_email_folder_on_sync_enabled_change" - updated
[info] > process definition: "analytics_channel_calculate_rfm" - updated
[info] > process definition: "convert_mailbox_email_to_lead" - updated
[info] > process definition: "magento_customer_creation" - updated
[info] > process definition: "magento_customer_export" - updated
[info] > process definition: "magento_customer_address_export" - updated
[info] > process definition: "magento_analytics_customer_calculate" - updated
[info] > process definition: "magento_analytics_customer_calculate_imported" - updated
[info] > process definition: "magento_schedule_integration" - updated
[info] > process definition: "convert_mailbox_email_to_case" - updated
[info] > process definition: "synchronize_marketing_list_item_for_mailchimp_member_activity" - updated
[info] > process definition: "create_email_campaign_for_mailchimp_campaign" - updated
[info] > process definition: "mailchimp_handle_member_state" - updated
[info] > process definition: "schedule_mailchimp_segment_synchronization" - updated
[info] > process definition: "dotmailer_email_campaign_creation" - updated
[info] > process definition: "dotmailer_contact_activity_update" - updated
[info] > process definition: "dotmailer_handle_contact_state" - updated
[info] > process definition: "schedule_dotmailer_address_book_synchronization" - updated
[info] > process definition: "dotmailer_handle_removed_address_book_contact" - updated
[info] Process definitions configuration updates are stored into database
[info] >> process trigger: analytics_channel_calculate_rfm [update] - updated
[info] >> process trigger: clear_imap_email_folder_on_sync_enabled_change [update] - updated
[info] >> process trigger: clear_user_email_origin_on_deactivation [update] - updated
[info] >> process trigger: create_email_campaign_for_mailchimp_campaign [create] - updated
[info] >> process trigger: dotmailer_contact_activity_update [create] - updated
[info] >> process trigger: dotmailer_contact_activity_update [update] - updated
[info] >> process trigger: dotmailer_email_campaign_creation [create] - updated
[info] >> process trigger: dotmailer_handle_contact_state [create] - updated
[info] >> process trigger: dotmailer_handle_contact_state [update] - updated
[info] >> process trigger: dotmailer_handle_removed_address_book_contact [delete] - updated
[info] >> process trigger: magento_analytics_customer_calculate [update] - updated
[info] >> process trigger: magento_analytics_customer_calculate_imported [create] - updated
[info] >> process trigger: magento_customer_address_export [update] - updated
[info] >> process trigger: magento_customer_creation [create] - updated
[info] >> process trigger: magento_customer_export [update] - updated
[info] >> process trigger: magento_schedule_integration [update] - updated
[info] >> process trigger: mailchimp_handle_member_state [update] - updated
[info] >> process trigger: schedule_dotmailer_address_book_synchronization [update] - updated
[info] >> process trigger: schedule_integration [update] - updated
[info] >> process trigger: schedule_integration [create] - updated
[info] >> process trigger: schedule_mailchimp_segment_synchronization [create] - updated
[info] >> process trigger: schedule_mailchimp_segment_synchronization [update] - updated
[info] >> process trigger: sync_email_flag_after_changed [update] - updated
[info] >> process trigger: synchronize_marketing_list_item_for_mailchimp_member_activity [create] - updated
[info] >> process triggers modifications stored in DB
Loading "main" data fixtures ...
  > loading Oro\Bundle\WorkflowBundle\Migrations\Data\ORM\UpdateDefinitionTranslations
  > loading Oro\Bundle\SalesBundle\Migrations\Data\ORM\UpdateFeaturesConfigs
  > loading Oro\Bundle\ScopeBundle\Migrations\Data\ORM\LoadDefaultScope
  > loading Oro\Bundle\MagentoBundle\Migrations\Data\ORM\CreateAccountEntities

  [Doctrine\ORM\Query\QueryException]                                                                                                                                   
  [Semantical Error] line 0, col 117 near 'customer_f2bbc387': Error: Class Oro\Bundle\SalesBundle\Entity\Customer has no field or association named customer_f2bbc387  

  [Doctrine\ORM\Query\QueryException]                                                                                                                             
  SELECT c FROM Oro\Bundle\MagentoBundle\Entity\Customer c LEFT JOIN Oro\Bundle\SalesBundle\Entity\Customer ca WITH ca.customer_f2bbc387 = c WHERE ca.id IS NULL  

oro:migration:data:load [--fixtures-type [FIXTURES-TYPE]] [--dry-run] [--bundles [BUNDLES]] [--exclude [EXCLUDE]] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-s|--shell] [--process-isolation] [-e|--env ENV] [--no-debug] [--disabled-listeners DISABLED-LISTENERS] [--] <command>

  [RuntimeException]                                                                                                                
  The command '/opt/bitnami/php/bin/php.bin' 'app/console' 'oro:migration:data:load' '--env=prod' terminated with an exit code: 1.  

oro:platform:update [--force] [--skip-assets] [--symlink] [--skip-translations] [--force-debug] [--timeout [TIMEOUT]] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-s|--shell] [--process-isolation] [-e|--env ENV] [--no-debug] [--disabled-listeners DISABLED-LISTENERS] [--] <command>

  [RuntimeException]                                                                                                                                      
  The command '/opt/bitnami/php/bin/php.bin' 'app/console' 'oro:platform:update' '--force' '--timeout=300' '--env=prod' terminated with an exit code: 1.                                                                                                                                                
mkudelya commented 7 years ago

Hi @leomasri

I suggest you set database state to original 1.10.13, delete cache folder and run upgrade. Do you have any customization ?

leomasri commented 7 years ago

Hi @mkudelya , thanks for the tip. But I don't have any customizations, so not sure how to move forward... :(

leomasri commented 7 years ago

Thanks @mkudelya for your help.

I've given up and started from scratch with a new 1.12 installation. I've managed to successfully upgrade it to 2.0 . However, after enabling Leads and Opportunities, I've getting a js error when trying to access /opportunity

I've tried clearing the cache and also running oro:requirejs:buildbut couldn't fix it.

Anybody ran into this?

Thanks!

2017-01-27-162242_1366x768_scrot

Uncaught TypeError: 'optionValues' must be of type {Array.<Array>|Array.<{name: string, values: Array.<Array>}>}
    at constructor.render (oro.min.js?version=0c729ca6:1527)
    at constructor.render (oro.min.js?version=0c729ca6:1529)
    at R.n.n.exports.t.renderItem (oro.min.js?version=0c729ca6:1488)
    at R.n.n.exports.t.renderAllItems (oro.min.js?version=0c729ca6:1488)
    at R.n.renderAllItems (oro.min.js?version=0c729ca6:1528)
    at R.n.renderAllItems (oro.min.js?version=0c729ca6:1488)
    at R.n.n.exports.t.render (oro.min.js?version=0c729ca6:1488)
    at R.n.render (oro.min.js?version=0c729ca6:1528)
    at R.n.render (oro.min.js?version=0c729ca6:1488)
    at R.n.n.exports.t.renderItem (oro.min.js?version=0c729ca6:1488)
leomasri commented 7 years ago

Also tried setting require js optimization flag to none in config.yml as per https://github.com/orocrm/platform/issues/110 and rebuild, but it didn't work either :(

leomasri commented 7 years ago

Thanks everybody for their help! closing this issue and following up in #241