Upgrade the Application to the Next Version
This guide explains how to upgrade Oro application to the next version in a development environment.
Tip
If you are looking for specific instructions on upgrading the source code itself, please refer to our detailed guide on Upgrading the Source Code to v6.0.
An absolute path to the directory where an application is installed will be used in the guide and will be referred to as <application-root-folder> further in this topic.
Note
We highly recommend running all the commands in this guide from the same user the web server runs (e.g., nginx or www-data).
To retrieve a new version and upgrade your Oro application instance, execute the following steps:
Navigate to the Oro application root folder.
cd <application-root-folder>
Make sure that no changes require the database schema update.
php bin/console oro:entity-extend:update --dry-run --env=prod
The platform update is possible only when the database schema is up-to-date.
Switch the application to maintenance mode.
php bin/console lexik:maintenance:lock --env=prod
Stop the cron tasks.
crontab -e
Comment this line.
*/1 * * * * /usr/bin/php <application-root-folder>/bin/console --env=prod oro:cron >> /dev/null
Stop all running consumers.
Create backups of your Database and Code.
Checkout the next application version’s source code. The code is usually stored in a git repository, and stable release versions are marked with git tags.
git fetch --tags git checkout <tag-name>
Remove old caches.
rm -rf var/cache/prod/
Set up your project source code with Composer.
composer install --prefer-dist --no-dev
Refer to the
UPGRADE.md
andCHANGELOG.md
files in the application repository for a list of changes in the code that may affect the upgrade of some customizations.Upgrade the platform.
php bin/console oro:platform:update --env=prod
Note
To speed up the update process, consider using
--schedule-search-reindexation
or--skip-search-reindexation
option:--schedule-search-reindexation
— postpone search reindexation process until the message queue consumer is started (on step 12 below).--skip-search-reindexation
— skip search reindexation. Later, you can start it manually using commands oro:search:reindex to update search index for the specified entities and oro:website-search:reindex to rebuild storefront search index. See Search Index: Indexation Process.
Note
When the following options are not provided, they are set up automatically for the
test
environment:–force
–skip-translations
–timeout=600
The verbose mode is always set to debug in the
test
environment.Remove the caches.
php bin/console cache:clear --env=prod
or, as an alternative:
rm -rf var/cache/prod/ php bin/console cache:warmup --env=prod
Enable cron.
crontab -e
Uncomment this line.
*/1 * * * * /usr/bin/php <application-root-folder>/bin/console --env=prod oro:cron >> /dev/null
Switch your application back to the normal mode from the maintenance mode.
php bin/console lexik:maintenance:unlock --env=prod
Run the consumer(s).
php 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.
See Also
Business Tip
Looking to harness the new trend of digital commerce? Check out our guide on a B2B marketplace platform.