cancel
Showing results for 
Search instead for 
Did you mean: 

Uninstall Extension Magento 2 and Clean Database (tables and datas)

SOLVED

Uninstall Extension Magento 2 and Clean Database (tables and datas)

I need to uninstall an extension in Magento 2.3.1, this extension was installed manually. I follow the follow steps (for example for the extension "Size Chart"):

bin/magento module:disable Bss_SizeChart --clear-static-content
rm -rf app/code/Bss/SizeChart
bin/magento cache:clean
bin/magento cache:flush
bin/magento setup:upgrade

But I have detected that there are still data and tables related to this extension in the database:

  • In the table `eav_attribute` there is a record associated with this module (which I must delete manually so as not to have errors on my website
  • In my database there is a table associated with this extension: `bss_size_chart`
  • In the table `setup_module` there is a record associated with this extension

My Questions

  • How can I know if there is more information associated with an extension that I want to delete?
  • Is there any way to be able to uninstall an extension and automatically delete all the records and tables in my database associated with the extension we want to delete?
1 ACCEPTED SOLUTION

Accepted Solutions

Re: Uninstall Extension Magento 2 and Clean Database (tables and datas)

@ManuelSissl  first of all there is no way which can delete the data automatically when you uninstall the module unless they have use database scheme instead of Install and upgrade scripts.

 

Magento 2.3.2 and above have facilitated you with this.

Many extension providers are now using database scheme instead of install and upgrade scripts which leads to automatically delete data as you uninstall it.

 

You can do one thing, you can check its install and upgrade scripts and check what exactly it is doing.

If it is creating new independent tables then you can delete them by using sql query.

 

So my suggestion is check its install or upgrade scripts and before deleting anything make sure that it does not depend on another otherwise you may face severe issues in it.

 

Thanks

View solution in original post

7 REPLIES 7

Re: Uninstall Extension Magento 2 and Clean Database (tables and datas)

@ManuelSissl  first of all there is no way which can delete the data automatically when you uninstall the module unless they have use database scheme instead of Install and upgrade scripts.

 

Magento 2.3.2 and above have facilitated you with this.

Many extension providers are now using database scheme instead of install and upgrade scripts which leads to automatically delete data as you uninstall it.

 

You can do one thing, you can check its install and upgrade scripts and check what exactly it is doing.

If it is creating new independent tables then you can delete them by using sql query.

 

So my suggestion is check its install or upgrade scripts and before deleting anything make sure that it does not depend on another otherwise you may face severe issues in it.

 

Thanks

Re: Uninstall Extension Magento 2 and Clean Database (tables and datas)

Thanks for your response, I would like to update to Magento 2.3.3 but in doing so I have many errors and they are difficult for me to solve them.

 

By the way, I will review these installation scripts and delete the extra tables and data as you have told me. Thank you very much!

Re: Uninstall Extension Magento 2 and Clean Database (tables and datas)

@ManuelSissl If you find it useful you can give Kudos and "Accept it as a Solution", so that it may be helpful for others also.

Re: Uninstall Extension Magento 2 and Clean Database (tables and datas)

Before accepting your answer as a solution, can you confirm that my steps are correct? or can you tell me the steps that you used please?

Re: Uninstall Extension Magento 2 and Clean Database (tables and datas)

@ManuelSissl why have you just delete this module instead you can also make it disable so that if you want to use it in future then you just have to enable it for start working.

 

And if you want to remove it completely then the steps you follow are right and you can now check if there is any data which you can remove.

 

If it solves your problem, then "Accept it as Solution".

 

Thanks

Re: Uninstall Extension Magento 2 and Clean Database (tables and datas)

Do you have any advice to upgrade my Magento 2.3.1 to Magento 2.3.3? Steps or something like that?

Re: Uninstall Extension Magento 2 and Clean Database (tables and datas)