Clean uninstallation or deactivation of Magento modules
Provides the capability to fully disable and uninstall Magento extensions
Uninstall features:
- Will run a sql uninstall script for module (must be called
uninstall.php
and be in sql directory) - Will attempt to uninstall using PEAR packaging commands (as in Magento Connect)
- If not package found then will use uninstall file specified in module
config.xml
(by default, it isetc/uninstall.txt
)
Install script features:
- Delete core_resource to force Magento to run install/upgrade scripts.
- Rewind core_resource to force Magento to run some install/upgrade scripts.
- Install module (modman file provided)
- Refresh cache and re-sign into Magento Admin
- Under
System > Configuration > Advanced
you will see MageTrashApp - For each module you have options to enable, disable, Uninstall
- For each module you have options to delete or rewind
core_resource
Place a file uninstall.txt
into the folder etc/
of your module to allow to be triggered by this module when you uninstall it.
If you wish to change the name of this uninstall.txt
file to something different, just set into the config.xml
file of your module, the following:
<config>
...
<uninstall>
<filename>myuninstallfile.txt</filename>
</uninstall>
</config>
The format of the content should start from the Magento root path. For example: you want to uninstall the module Namespace_Mymodule
placed into the community code pool.
Just add the following lines to the file:
app/code/community/Namespace/Mymodule
app/etc/modules/Namespace_Mymodule.xml
js/mynamespace/
skin/frontend/base/default/images/mynapespace
If you have modman, you can copy the modman file into the etc
folder of your module (app/code/.../Mynamespace/Mymodule/etc/) and rename it to uninstall.txt
file. In this case, the second part of each line will be taken to uninstall your module.
For example:
src/app/code/community/Namespace/Mymodule app/code/community/Namespace/Mymodule
src/app/etc/modules/Namespace_Mymodule.xml app/etc/modules/Namespace_Mymodule.xml
- Tom Kadwill
- Sylvain Rayé
- wsakaren
- Damian Luszczymak
Complete and working.