How do I upgrade Oro Platform

Step 1. Turn the maintenance mode on

app/console lexik:maintenance:lock --env prod

I think, the warning «Ttl doesn’t work with Lexik\Bundle\MaintenanceBundle\Drivers\FileDriver driver» can be ignored.

Step 2. Stop Cron

sudo service cron stop

Step 3. Stop Supervisor

sudo service supervisor stop

Step 4. Backup the database

mysqldump erp > ~/erp-backup/prev.sql

Step 5. Go to the installation folder

cd ~/erp

Step 6. Backup the files

rm -rf app/logs/*
tar cvf - . | gzip > ~/erp-backup/prev.tar.gz

6A. Restoring the files (if something went wrong)

rm -rf ~/erp && mkdir ~/erp && tar xf ~/erp-backup/prev.tar.gz -C ~/erp

Step 7. Get the new files

git fetch origin
git reset --hard origin/<branch, e.g. 2.2 or master>
git pull origin <branch, e.g. 2.2 or master>

Step 8. Update Composer

sudo composer self-update

Step 9. Update Composer packages

composer update --prefer-source

Step 10. Delete the cache using «rm -rf»

rm -rf app/cache/*

Step 11. Run the OroPlatform upgrading scripts

app/console oro:platform:update --env=prod --force

Step 12. Delete the cache using «app/console cache:clear»

app/console cache:clear --env prod

Step 13 Fix the websocket server issue

It is alleady fixed in 2.5.0:


My fix for old versions (2.1.2):

Open the file:

vendor/oro/platform/src/Oro/Bundle/SyncBundle/WebSocket/Client/Rfc6455.php

Locate the line:

Add the following line above:

stream_set_timeout($this->socket, 3);

Step 14. Start Supervisor

sudo service supervisor start

Step 15. Start Cron

sudo service cron start

Step 16. Turn the maintenance mode off

app/console lexik:maintenance:unlock --env prod

I think, the failure «Impossible to do this action» can be ignored.

Step 17

Delete the backups:

rm -f ~/erp-backup/prev.sql ~/erp-backup/prev.tar.gz