3

We have been been asked to remove all customer data from our systems - easy on Linnworks - seems impossible in Magento

2 Answers 2

2

If you just want to anonymise the email in the order data, you can do so with a mysql query like so.

UPDATE sales_order SET customer_email = '[email protected]' WHERE customer_email = '[email protected]';

Although this doesn't account for all their other personal information (addresses, payment data etc).

If you want to go through manually and remove/anonymise all their personal data you can work from the data references in the DevDocs

https://devdocs.magento.com/compliance/privacy/pi-data-reference-m2.html#database-entities

But the most scaleable / quickest solution to handle this would be to opt for a module thats already provides this functionality.

https://github.com/opengento/magento2-gdpr

https://amasty.com/gdpr-for-magento-2.html

0
1

Backup your database and then run below sql query on database to remove all customer data.

SET FOREIGN_KEY_CHECKS = 0;

TRUNCATE TABLE `customer_address_entity`;
TRUNCATE TABLE `customer_address_entity_datetime`;
TRUNCATE TABLE `customer_address_entity_decimal`;
TRUNCATE TABLE `customer_address_entity_int`;
TRUNCATE TABLE `customer_address_entity_text`;
TRUNCATE TABLE `customer_address_entity_varchar`;
TRUNCATE TABLE `customer_entity`;
TRUNCATE TABLE `customer_entity_datetime`;
TRUNCATE TABLE `customer_entity_decimal`;
TRUNCATE TABLE `customer_entity_int`;
TRUNCATE TABLE `customer_entity_text`;
TRUNCATE TABLE `customer_entity_varchar`;
TRUNCATE TABLE `customer_grid_flat`;
TRUNCATE TABLE `customer_log`;
TRUNCATE TABLE `customer_visitor`;
TRUNCATE TABLE `persistent_session`;

SET FOREIGN_KEY_CHECKS = 1;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.