Before you use these commands, you must install the application.
To update the application:
git clone
), see Update the application.The way you reinstall the application from the command line depends on your role:
git clone
), see Update installation dependencies.Uninstalling the application drops and restores the database, removes the deployment configuration, and clears directories under var
.
To uninstall the application, enter the following command:
bin/magento setup:uninstall
The following message displays to confirm a successful uninstallation:
[SUCCESS]: Magento uninstallation complete.
By default, bin/magento setup:upgrade
clears compiled code and the cache. Typically, you use bin/magento setup:upgrade
to update components and each component can require different compiled classes.
However, in some situations (particularly, deploying to production), you might wish to avoid clearing compiled code because it can take some time. (The cache is still cleared.) To update the database schema and data without clearing compiled code, enter:
bin/magento setup:upgrade --keep-generated
The optional --keep-generated
option should be used in limited circumstances by experienced system integrators only. This option should never be used in a development environment. Improper use of this optional parameter can cause errors during code execution.