Uninstalling eCommerce and removing eCommerce tables or references from your Drupal database (MYSQL)

Introduction

The following outlines, step by step, how to remove eCommerce from your Drupal site.

eCommerce includes a large amount of modules by many contributers and sometimes, when troubleshooting an installation or helping to test a new version, it's useful to be able to wipe the slate clean, so to speak and remove all modules and eCommerce tables from your Drupal database, so you can start again from scratch.

Step 1 of 2 - Removing eCommerce modules

  1. Make a backup of your Drupal database
  2. Under SITE BUILDING -> MODULES, disable the eCommerce modules. Note that this may require a few submissions, because of module dependencies, you cannot disable some modules, before you disable others.
  3. Once you have disabled all eCommerce related modules under SITE BUILDING -> MODULES click on the UNINSTALL tab and confirm you want to uninstall the list of modules presented
  4. Using FTP or your preferred file manager, remove the entire eCommerce folder from your server

Step 2 of 2 - Clearing up the database

Please note: The following snippet is intended for removing Drupal eCommerce version 5.x-3.x.

Because of the scale of eCommerce and continuing development, it's common to find contributed modules where the module maintainer has not yet included a complete UNINSTALL routine in their module. A typical UNINSTALL routine would normally remove all references of the module in the system folder and change/remove the relevant database tables from your Drupal database.

Therefore, the following MYSQL snippet is useful for running an eCommerce database clean up. Particularly if you want to re-install eCommerce or have run into problems with your installation and would like to start from scratch.

  1. If you haven't already, make a backup of your Drupal database
  2. In PHPMYADMIN or your preferred MYSQL databade editor paste the following snippet into your SQL tab and execute the snippet


TRUNCATE TABLE cache;
TRUNCATE TABLE cache_content;
TRUNCATE TABLE cache_filter;
TRUNCATE TABLE cache_menu;
TRUNCATE TABLE cache_page;
TRUNCATE TABLE cache_views;

DELETE FROM variable WHERE
`name` LIKE 'ec_%'
OR `name` LIKE 'ecommerce%'
OR `name` LIKE 'shipping%'
OR `name` LIKE 'payment%'
OR `name` LIKE 'product%'
;
DELETE FROM system WHERE filename LIKE '%ecommerce%';

DELETE FROM node WHERE type LIKE "%product%"'

DROP TABLE IF EXISTS ec_address;
DROP TABLE IF EXISTS ec_anon;
DROP TABLE IF EXISTS ec_audit;
DROP TABLE IF EXISTS ec_authorize_net;
DROP TABLE IF EXISTS ec_cart;
DROP TABLE IF EXISTS ec_credit_card;
DROP TABLE IF EXISTS ec_customer;
DROP TABLE IF EXISTS ec_invoice;
DROP TABLE IF EXISTS ec_mail;
DROP TABLE IF EXISTS ec_product;
DROP TABLE IF EXISTS ec_product_features;
DROP TABLE IF EXISTS ec_product_ptypes;
DROP TABLE IF EXISTS ec_product_tangible;
DROP TABLE IF EXISTS ec_receipt;
DROP TABLE IF EXISTS ec_receipt_allocation;
DROP TABLE IF EXISTS ec_receipt_paypal;
DROP TABLE IF EXISTS ec_receipt_types;
DROP TABLE IF EXISTS ec_renewal;
DROP TABLE IF EXISTS ec_shipping_product;
DROP TABLE IF EXISTS ec_shipping_product_attribute;
DROP TABLE IF EXISTS ec_shipping_shipfrom;
DROP TABLE IF EXISTS ec_shipping_transaction;
DROP TABLE IF EXISTS ec_sp_attribute;
DROP TABLE IF EXISTS ec_sp_bpattribute;
DROP TABLE IF EXISTS ec_sp_pattribute;
DROP TABLE IF EXISTS ec_sp_pproduct;
DROP TABLE IF EXISTS ec_sp_variation;
DROP TABLE IF EXISTS ec_tax;
DROP TABLE IF EXISTS ec_tmp;
DROP TABLE IF EXISTS ec_transaction;
DROP TABLE IF EXISTS ec_transaction_address;
DROP TABLE IF EXISTS ec_transaction_misc;
DROP TABLE IF EXISTS ec_transaction_product;

Notes

  • More discussion about this SQL snippet can be found across on the issue queue for eCommerce on Drupal.or
  • Please add a child page for improvements to this snippet and/or updates for eCommerce version 5.x-4 and subsequent versions
  • If you spot any errors, omissions or have ideas for improvements, please drop me an email (Dublin Drupaller) so I can update the page.

Comments

The difference between the

The difference between the right word and the almost right word is really a large matter — it's the difference between a lightning bug and the lightning.
online high school | affordable diploma | online high school diploma | distance learning online | earn high school diploma