cancel
Showing results for 
Search instead for 
Did you mean: 

Restore deleted customers from orders possible (deleted accidentally)

Restore deleted customers from orders possible (deleted accidentally)

Magento 2.4.3

I was going to delete a screen of 20 customers by "select all" -> Delete and this lead to all customers being deleted. I suppose it should say that it would delete ALL customers when selecting all rather than just all on that page.

 

I do not have a backup recent enough - I know - my bad.

Is there a way to recreate customers in DB from orders? because all orders and all is still there... but I suppose some features will start breaking when the customer IDs are not available anymore in some table(s), right?

 

thanks!

1 REPLY 1

Re: Restore deleted customers from orders possible (deleted accidentally)

@rossitrick1adb 

You can create customers programmatically using order collection data and get the customer email, customer name, and customer address from the order as well.
 
For that, you can use this kind of code to create customers programmatically and such code to Set Shipping And Billing Address From Order To Customer Address!
Problem solved? Click Kudos and "Accept as Solution".
200+ Magento 2 Extensions for Enhanced Shopping Experience.