Upgrading to the Newer Version¶
To retrieve source code of a new version and upgrade your OroCRM instance, please execute the following steps:
cd
to the OroCRM root folder and switch the application to the maintenance mode.
cd /path/to/application
sudo -uwww-data bin/console lexik:maintenance:lock --env=prod
Stop the cron tasks.
crontab -e -uwww-data
Note
The www-data may be replaced with the user under which your web server runs.
Comment this line.
1 */1 * * * * /usr/bin/php /path/to/application/bin/console --env=prod oro:cron >> /dev/null
Stop all running consumers.
Create backups of your database and source code.
Pull the changes from the necessary branch (1.6) or tag (1.6.1) in the application repository (e.g.
https://github.com/oroinc/orocrm-application.git
) or download the latest OroCRM version from the download section on the oroinc.local/orocrm , unpack archive and overwrite existing system files.Note
- If you have any customization or third party extensions installed, make sure that:
- your changes to “src/AppKernel.php” file are merged to the new file.
- your changes to “src/” folder are merged and it contains the custom files.
- your changes to “composer.json” file are merged to the new file.
- your changes to configuration files in “config/” folder are merged to the new files.
sudo -uwww-data git pull sudo -uwww-data git checkout <branch or tag with version to upgrade to>
Upgrade the composer dependency and set up the right owner to the retrieved files.
sudo -u www-data php composer.phar install --prefer-dist --no-dev
Remove old caches.
sudo rm -rf var/cache/* sudo rm -rf public/js/* sudo rm -rf public/css/*
Upgrade the platform.
sudo -u www-data php bin/console oro:platform:update --env=prod --force
Remove the caches.
sudo -u www-data bin/console cache:clear --env=prod
or, as alternative:
sudo rm -rf var/cache/* sudo -u www-data bin/console cache:warmup --env=prod
Enable cron.
crontab -e -uwww-data
Uncomment this line.
1 */1 * * * * /usr/bin/php /path/to/application/bin/console --env=prod oro:cron >> /dev/null
Switch your application back to normal mode from the maintenance mode.
sudo -uwww-data bin/console lexik:maintenance:unlock --env=prod
Run the consumer(s).
sudo -u www-data bin/console oro:message-queue:consume --env=prod
Note
If PHP bytecode cache tools (e.g. opcache) are used, PHP-FPM (or Apache web server) should be restarted after the upgrade to flush cached bytecode from the previous installation.