Sometimes when you working on Magento project you need to have some live data on your local machine to test functionality. So, you need to import live DB. But you don’t want to accidentally send any emails to existing live customers of course.
Here is the mysql query that will mixup a customer emails:
1 |
update customer_entity set email = concat('customer_', entity_id, '@localhost.dev'); |
1 |
update customer_entity set email = concat('local_', email); |
Choose one you like. The only difference is a produced emails. First variant produce customer_12345@localhost.dev
alike emails. The second one will produce local_real@email.com
alike emails to preserve email original values for further work on them.
Why not to use this query? :
update customer_entity set email = concat(email, ‘.dev’);
Yes, you can use this too. But for example some developer, you don’t want to share those emails with, works on your magento store?
Then:
update customer_entity set email = concat(‘customer_’, entity_id, ‘@localhost.dev’);
)
Yes, that will work as well. Updated article 🙂