Some useful console commands for me

command-line
(Dmitry Fedyuk) #1

Removing the cache

sudo service cron stop && sudo service supervisor stop && \
rm -rf app/cache/* && \
sudo service cron start && sudo service supervisor start

Another way:

app/console cache:clear
app/console cache:clear --env=prod

Switching the root URL

mysql --database=crm -e \
"UPDATE oro_config_value \
SET text_value = 'https://localhost.com:848' \
WHERE name = 'application_url';"

Resolving the filesystem permission problems on localhost

chmod -R -v 777 .

Backup the code and database

mysqldump erp > ~/erp-backup/$(date '+%Y-%m-%d-%H-%M').sql && \
tar -zcvf ~/erp-backup/$(date '+%Y-%m-%d-%H-%M').tgz .

Restoring the database from a backup

sudo service cron stop && sudo service supervisor stop && \
mysql -e "DROP DATABASE erp; CREATE DATABASE erp;" && \
mysql erp < ~/erp-backup/2017-05-28-17-06.sql && \
rm -rf app/cache/* && \
sudo service cron start && sudo service supervisor start

Starting Websocket server and message consumer in the developer mode

app/console clank:server -vvv
app/console oro:message-queue:consume -vvv

Restoring the production database on my local PC

mysql -e "DROP DATABASE erp; CREATE DATABASE erp;" && \
mysql erp < 2017-05-25-14-39.sql && \
mysql -D erp -e "UPDATE oro_config_value SET text_value = 'https://localhost.com:848' WHERE name = 'application_url'"
0 Likes