ssossossossosso
Documentation Home »Developer Guide »The Oro Cookbook »How to Upgrade to a New Version
current version

How to Upgrade to a New Version

1. Checkout from the GitHub Repository

To retrieve a new version and upgrade your OroCRM instance, please execute the following steps:

1. cd to the crm root folder and switch the application to the maintenance mode.

$ cd /path/to/application
$ sudo -uwww-data bin/console lexik:maintenance:lock --env prod

2. Stop the cron tasks.

$ crontab -e -uwww-data

Note

www-data can be changed to 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

3. Create backups of your Database and Code.

4. Pull changes from the repository.

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 <VERSION TO UPGRADE>

5. Upgrade the composer dependency and set up the right owner to the retrieved files.

$ sudo php composer.phar install --prefer-dist --no-dev
$ sudo chown www-data:www-data -R ./*

6. Remove old caches.

$ sudo rm -rf var/cache/prod

7. Upgrade the platform.

$ sudo -u www-data php bin/console oro:platform:update --env=prod --force

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 9 below).
  • –skip-search-reindexation — skip search reindexation. Later, you can start it manually using the oro:search:reindex and oro:website-search:reindex commands. See Search Index: Indexation Process.

8. Remove the caches.

$ sudo -u www-data bin/console cache:clear --env prod

or, as alternative:

$ sudo rm -rf var/cache/prod
$ sudo -u www-data bin/console cache:warmup --env prod

9. Run the consumer(s).

$ sudo -u www-data bin/console oro:message-queue:consume --env prod

10. 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

11. Switch your application back to normal mode from the maintenance mode.

$ sudo -uwww-data bin/console lexik:maintenance:unlock --env prod

Note

If PHP bytecode cache tools (e.g. opcache) are used, PHP-FPM (or Apache web server) should be restarted after the uprgade to flush cached bytecode from the previous installation.

2. Download the Source Code Archive

To retrieve a new version and upgrade your OroCRM instance, please execute the following steps:

1. cd to the crm root folder and switch the application to the maintenance mode.

$ cd /path/to/application
$ sudo -uwww-data bin/console lexik:maintenance:lock --env prod

2 Stop the cron tasks.

$ crontab -e -uwww-data

Note

www-data can be changed to 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

3. Stop all running consumers.

4. Create backups of your Database and Code.

5. Download the latest OroCRM version from the download section on orocrm.com , 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.
  • upgrade the composer dependency and set up right owner to the retrieved files.
$ sudo php composer.phar update --prefer-dist --no-dev
$ sudo chown www-data:www-data -R ./*

6. Remove old caches.

$ sudo rm -rf var/cache/prod

7. Upgrade the platform.

$ sudo -u www-data php bin/console oro:platform:upgrade20 --env=prod --force

8. Remove the caches.

$ sudo -u www-data bin/console cache:clear --env prod

or, as alternative:

$ sudo rm -rf var/cache/prod
$ sudo -u www-data bin/console cache:warmup --env prod

9. Run the consumer(s).

$ sudo -u www-data bin/console oro:message-queue:consume --env prod

10. 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

11. Switch your application back to normal mode from the maintenance mode.

$ sudo -uwww-data bin/console lexik:maintenance:unlock --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.

Browse maintained versions:
current1.122.02.32.6

You will be redirected to [title]. Would you like to continue?

Yes No
ssossossossosso